@actioneer/ads 0.5.7 → 0.5.9

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 (147) hide show
  1. package/bin/ads-init.mjs +6 -0
  2. package/components/accordion.js +50 -48
  3. package/components/agent-icon.d.ts +12 -0
  4. package/components/agent-icon.js +133 -120
  5. package/components/ai-elements/chain-of-thought.d.ts +1 -1
  6. package/components/ai-elements/chain-of-thought.js +108 -108
  7. package/components/ai-elements/chart.js +16 -14
  8. package/components/ai-elements/inline-citation.js +41 -41
  9. package/components/ai-elements/message.js +4 -4
  10. package/components/ai-elements/queue.js +7 -7
  11. package/components/ai-elements/research-activity.js +114 -114
  12. package/components/ai-elements/shimmer.d.ts +2 -2
  13. package/components/ai-elements/speech-input.js +28 -28
  14. package/components/ai-elements/task-progress.js +26 -16
  15. package/components/ai-elements/task.js +17 -17
  16. package/components/ai-elements/tool.js +6 -6
  17. package/components/ai-elements/transcript.js +6 -5
  18. package/components/ai-elements/voice.js +1 -1
  19. package/components/alert.js +10 -10
  20. package/components/answer-sources.js +1 -1
  21. package/components/answer.js +115 -114
  22. package/components/assistant-ui/action-bar.js +94 -48
  23. package/components/assistant-ui/attachment.js +103 -75
  24. package/components/assistant-ui/badge.d.ts +1 -1
  25. package/components/assistant-ui/badge.js +17 -17
  26. package/components/assistant-ui/chain-of-thought.d.ts +1 -1
  27. package/components/assistant-ui/composer-add-context.js +9 -9
  28. package/components/assistant-ui/composer-deep-research.js +5 -5
  29. package/components/assistant-ui/composer-harness.js +11 -9
  30. package/components/assistant-ui/composer-trigger-popover.js +45 -34
  31. package/components/assistant-ui/composer.js +59 -59
  32. package/components/assistant-ui/error.js +14 -14
  33. package/components/assistant-ui/file.d.ts +1 -1
  34. package/components/assistant-ui/image.d.ts +1 -1
  35. package/components/assistant-ui/image.js +113 -103
  36. package/components/assistant-ui/markdown-text.js +18 -18
  37. package/components/assistant-ui/message.js +46 -45
  38. package/components/assistant-ui/quote.js +1 -1
  39. package/components/assistant-ui/reasoning.d.ts +1 -1
  40. package/components/assistant-ui/reasoning.js +66 -77
  41. package/components/assistant-ui/suggestions.js +4 -4
  42. package/components/assistant-ui/thread.js +22 -22
  43. package/components/assistant-ui/tool-fallback.js +60 -63
  44. package/components/assistant-ui/tool-group.d.ts +1 -1
  45. package/components/assistant-ui/tool-group.js +36 -42
  46. package/components/audio-waveform.js +25 -24
  47. package/components/autocomplete.d.ts +1 -0
  48. package/components/autocomplete.js +45 -43
  49. package/components/avatar.d.ts +1 -0
  50. package/components/avatar.js +27 -26
  51. package/components/badge.d.ts +1 -1
  52. package/components/breadcrumbs.d.ts +2 -0
  53. package/components/breadcrumbs.js +52 -50
  54. package/components/button.d.ts +2 -2
  55. package/components/button.js +22 -20
  56. package/components/card.js +8 -8
  57. package/components/carousel.js +105 -104
  58. package/components/chart.d.ts +6 -0
  59. package/components/chart.js +743 -672
  60. package/components/checkbox.js +74 -38
  61. package/components/chip.d.ts +1 -1
  62. package/components/code-block.js +3 -3
  63. package/components/collapsible.js +67 -23
  64. package/components/connector-card.js +6 -6
  65. package/components/drawer.d.ts +18 -11
  66. package/components/drawer.js +81 -78
  67. package/components/dropdown.d.ts +2 -0
  68. package/components/dropdown.js +88 -79
  69. package/components/empty-state.d.ts +1 -1
  70. package/components/empty-state.js +7 -7
  71. package/components/field.d.ts +4 -0
  72. package/components/field.js +45 -34
  73. package/components/file-dropzone.js +12 -12
  74. package/components/index.d.ts +3 -0
  75. package/components/index.js +584 -558
  76. package/components/input-field.js +51 -46
  77. package/components/input.js +20 -20
  78. package/components/link.js +9 -9
  79. package/components/modal.d.ts +5 -1
  80. package/components/modal.js +121 -76
  81. package/components/navbar.d.ts +1 -1
  82. package/components/navbar.js +1 -1
  83. package/components/number-field.js +38 -29
  84. package/components/page-header.js +12 -12
  85. package/components/pagination.js +19 -19
  86. package/components/panel.js +2 -2
  87. package/components/pixel-blast-svg.js +3 -3
  88. package/components/pixel-icon.d.ts +4 -0
  89. package/components/pixel-icon.js +210 -164
  90. package/components/popover.d.ts +1 -1
  91. package/components/popover.js +66 -64
  92. package/components/progress-circle.js +36 -32
  93. package/components/progress.js +28 -24
  94. package/components/radio.js +59 -49
  95. package/components/resizable-panel.js +1 -1
  96. package/components/reveal.d.ts +2 -2
  97. package/components/ripple.d.ts +3 -3
  98. package/components/scroll-area.js +17 -16
  99. package/components/segmented.d.ts +1 -0
  100. package/components/segmented.js +39 -36
  101. package/components/select.d.ts +7 -0
  102. package/components/select.js +186 -137
  103. package/components/setting-row.js +45 -42
  104. package/components/sidebar.js +131 -127
  105. package/components/skeleton.js +5 -5
  106. package/components/spinner.d.ts +13 -4
  107. package/components/spinner.js +42 -42
  108. package/components/stepper.js +21 -21
  109. package/components/switch.js +41 -39
  110. package/components/table.d.ts +16 -0
  111. package/components/table.js +393 -260
  112. package/components/tabs.js +149 -137
  113. package/components/toast.js +66 -66
  114. package/components/tooltip.js +2 -2
  115. package/components/tree.js +62 -51
  116. package/components/typography.d.ts +2 -1
  117. package/components/typography.js +33 -32
  118. package/components/ui/button.d.ts +2 -2
  119. package/components/ui/button.js +19 -19
  120. package/components/ui/collapsible.d.ts +1 -5
  121. package/components/ui/dialog.d.ts +3 -3
  122. package/components/ui/dialog.js +95 -58
  123. package/components/ui/tooltip.d.ts +2 -2
  124. package/components/ui/tooltip.js +67 -33
  125. package/components/viz-charts.js +95 -95
  126. package/demo/components/add-to-artifact.js +363 -0
  127. package/demo/lib/artifact-library.js +142 -0
  128. package/demo/lib/artifact-pin-guard.js +12 -0
  129. package/fonts/aribau-grotesk-medium.woff2 +0 -0
  130. package/fonts/aribau-grotesk-regular.woff2 +0 -0
  131. package/fonts.css +11 -11
  132. package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
  133. package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
  134. package/lib/icons.d.ts +24 -0
  135. package/lib/icons.js +114 -108
  136. package/lib/motion.d.ts +42 -39
  137. package/lib/motion.js +112 -52
  138. package/lib/spinner-mark.d.ts +9 -0
  139. package/lib/spinner-mark.js +98 -0
  140. package/llms.txt +53 -19
  141. package/manifest.json +258 -36
  142. package/package.json +1 -1
  143. package/styles.css +143 -124
  144. package/theme.css +90 -93
  145. package/components/ui/collapsible.js +0 -35
  146. package/fonts/aribau-grotesk-500.otf +0 -0
  147. package/fonts/aribau-grotesk-600.woff2 +0 -0
@@ -22,10 +22,10 @@ function ue({
22
22
  }
23
23
  const w = "flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-xs text-left outline-none transition-colors hover:bg-muted focus-visible:bg-muted [&_svg]:size-4 [&_svg]:shrink-0 [&_img]:size-4 [&_img]:shrink-0 [&_img]:rounded-xs", _ = (o) => o.map((t) => t.label).slice(1).join(" · "), te = (o) => o.startsWith("mem.") || o.startsWith("skill.");
24
24
  function fe() {
25
- const o = E(S), t = E(T), a = V(), B = X((e) => e.attachments), [c, b] = y(!1), [u, h] = y([]), g = A(null), k = A(null), [d, O] = y(null);
25
+ const o = E(S), t = E(T), a = V(), B = X((e) => e.attachments), [c, g] = y(!1), [u, h] = y([]), b = A(null), k = A(null), [d, O] = y(null);
26
26
  if (U(() => {
27
27
  if (!c) return;
28
- const e = g.current;
28
+ const e = b.current;
29
29
  if (!e) return;
30
30
  const r = () => {
31
31
  const s = e.getBoundingClientRect();
@@ -41,9 +41,9 @@ function fe() {
41
41
  const e = (s) => {
42
42
  var f, x;
43
43
  const i = s.target;
44
- (f = k.current) != null && f.contains(i) || (x = g.current) != null && x.contains(i) || b(!1);
44
+ (f = k.current) != null && f.contains(i) || (x = b.current) != null && x.contains(i) || g(!1);
45
45
  }, r = (s) => {
46
- s.key === "Escape" && (s.preventDefault(), h((i) => i.length ? i.slice(0, -1) : (b(!1), i)));
46
+ s.key === "Escape" && (s.preventDefault(), h((i) => i.length ? i.slice(0, -1) : (g(!1), i)));
47
47
  };
48
48
  return document.addEventListener("pointerdown", e), document.addEventListener("keydown", r), () => {
49
49
  document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", r);
@@ -61,13 +61,13 @@ function fe() {
61
61
  /* @__PURE__ */ n(
62
62
  G,
63
63
  {
64
- ref: g,
64
+ ref: b,
65
65
  tooltip: "Add context",
66
66
  side: "top",
67
67
  "aria-label": "Add context",
68
68
  "aria-expanded": c,
69
69
  type: "button",
70
- onClick: () => b((e) => !e),
70
+ onClick: () => g((e) => !e),
71
71
  className: "aui-composer-add-context hover:bg-muted-foreground/15 size-7 rounded-full p-1",
72
72
  children: /* @__PURE__ */ n(J, { className: "size-4.5 stroke-[1.5px]" })
73
73
  }
@@ -98,12 +98,12 @@ function fe() {
98
98
  type: "button",
99
99
  "aria-label": "Back",
100
100
  onClick: () => h((e) => e.slice(0, -1)),
101
- className: "flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring [&_svg]:size-4",
101
+ className: "flex size-6 shrink-0 items-center justify-center rounded-sm text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring [&_svg]:size-4",
102
102
  children: /* @__PURE__ */ n(Q, {})
103
103
  }
104
104
  ),
105
- /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-xs font-semibold text-muted-foreground", children: u.map((e) => e.label).join(" · ") })
106
- ] }) : /* @__PURE__ */ n("div", { className: "px-2 py-1 text-xs font-semibold text-muted-foreground", children: "Agent's context" }),
105
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-xs font-medium text-muted-foreground", children: u.map((e) => e.label).join(" · ") })
106
+ ] }) : /* @__PURE__ */ n("div", { className: "px-2 py-1 text-xs font-medium text-muted-foreground", children: "Agent's context" }),
107
107
  (l == null ? void 0 : l.addable) && (() => {
108
108
  const e = _(u), r = v.has(e);
109
109
  return /* @__PURE__ */ m(
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs as s, jsx as r } from "react/jsx-runtime";
3
- import { createContext as u, useContext as a } from "react";
4
- import { Telescope as c } from "../../lib/icons.js";
3
+ import { createContext as u, useContext as c } from "react";
4
+ import { Telescope as a } from "../../lib/icons.js";
5
5
  import { cn as n } from "../../lib/cn.js";
6
6
  const t = u(null);
7
7
  function p({
@@ -11,7 +11,7 @@ function p({
11
11
  return /* @__PURE__ */ r(t.Provider, { value: o, children: e });
12
12
  }
13
13
  function x() {
14
- const o = a(t);
14
+ const o = c(t);
15
15
  if (!o) return null;
16
16
  const { enabled: e, setEnabled: i } = o;
17
17
  return (
@@ -30,14 +30,14 @@ function x() {
30
30
  e ? "bg-info-50 text-info-700 hover:bg-info-100" : "text-muted-foreground hover:bg-muted-foreground/15 hover:text-foreground"
31
31
  ),
32
32
  children: [
33
- /* @__PURE__ */ r(c, { className: "size-4 shrink-0" }),
33
+ /* @__PURE__ */ r(a, { className: "size-4 shrink-0" }),
34
34
  "Deep research",
35
35
  /* @__PURE__ */ r(
36
36
  "span",
37
37
  {
38
38
  "aria-hidden": !0,
39
39
  className: n(
40
- "size-1.5 shrink-0 rounded-dot transition-colors duration-(--duration-fast) ease-out motion-reduce:transition-none",
40
+ "size-1.5 shrink-0 rounded-dot transition-colors duration-150 ease-out motion-reduce:transition-none",
41
41
  e ? "bg-info-600" : "bg-muted-foreground/40"
42
42
  )
43
43
  }
@@ -7,7 +7,7 @@ import { useComposerRuntime as d, useComposer as u } from "@assistant-ui/react";
7
7
  import "clsx";
8
8
  import "tailwind-merge";
9
9
  import "../../lib/interactive.js";
10
- import "radix-ui";
10
+ import "../ui/tooltip.js";
11
11
  import "../button.js";
12
12
  import "../spinner.js";
13
13
  import "../reveal.js";
@@ -23,7 +23,7 @@ import "../scroll-area.js";
23
23
  import "../stepper.js";
24
24
  import "../resizable-panel.js";
25
25
  import "react";
26
- import { Bolt as a, ChevronDown as f, CheckList as h, Sparkles as g } from "../../lib/icons.js";
26
+ import { Bolt as a, ChevronDown as h, CheckList as f, Sparkles as g } from "../../lib/icons.js";
27
27
  import "react-dom";
28
28
  import "motion/react";
29
29
  import "../ripple.js";
@@ -97,6 +97,8 @@ import "./thread-context.js";
97
97
  import "./tooltip-icon-button.js";
98
98
  import "./composer-add-context.js";
99
99
  import "zustand/shallow";
100
+ import "../ui/dialog.js";
101
+ import "radix-ui";
100
102
  import "./composer-deep-research.js";
101
103
  import "./composer-trigger-popover.js";
102
104
  import "./directive-text.js";
@@ -117,7 +119,7 @@ const m = "application/x-actioneer-harness", S = [
117
119
  {
118
120
  id: "metric",
119
121
  label: "Metric analysis",
120
- icon: /* @__PURE__ */ e(h, {}),
122
+ icon: /* @__PURE__ */ e(f, {}),
121
123
  instructions: "Define the metric, grain, population, and time window before calculating. Call out comparisons, denominator changes, and any data-quality caveats."
122
124
  },
123
125
  {
@@ -127,7 +129,7 @@ const m = "application/x-actioneer-harness", S = [
127
129
  instructions: "Write a concise executive brief: lead with the decision or insight, use only decision-relevant evidence, and end with the recommended next action."
128
130
  }
129
131
  ];
130
- function wi() {
132
+ function Ai() {
131
133
  const r = d(), t = u((i) => i.attachments), o = new Set(
132
134
  t.filter((i) => i.contentType === m).map((i) => i.name)
133
135
  ), s = (i) => {
@@ -146,10 +148,10 @@ function wi() {
146
148
  /* @__PURE__ */ e(a, { className: "size-4 shrink-0" }),
147
149
  "Add harness",
148
150
  /* @__PURE__ */ e(
149
- f,
151
+ h,
150
152
  {
151
153
  "aria-hidden": !0,
152
- className: "size-3.5 shrink-0 opacity-60 transition-transform duration-(--duration-fast) ease-out group-data-[state=open]:rotate-180 motion-reduce:transition-none"
154
+ className: "size-3.5 shrink-0 opacity-60 transition-transform duration-150 ease-out group-data-[state=open]:rotate-180 motion-reduce:transition-none"
153
155
  }
154
156
  )
155
157
  ]
@@ -170,7 +172,7 @@ function wi() {
170
172
  ] })
171
173
  ] });
172
174
  }
173
- class Si {
175
+ class Ci {
174
176
  constructor() {
175
177
  p(this, "accept", m);
176
178
  }
@@ -203,7 +205,7 @@ ${o}
203
205
  }
204
206
  }
205
207
  export {
206
- wi as ComposerHarness,
208
+ Ai as ComposerHarness,
207
209
  m as HARNESS_MIME,
208
- Si as HarnessAttachmentAdapter
210
+ Ci as HarnessAttachmentAdapter
209
211
  };
@@ -3,22 +3,23 @@ import { jsxs as s, jsx as e } from "react/jsx-runtime";
3
3
  import { memo as h, useRef as b } from "react";
4
4
  import { ComposerPrimitive as n, unstable_defaultDirectiveFormatter as u, unstable_useTriggerPopoverScopeContext as N } from "@assistant-ui/react";
5
5
  import { Sparkles as y, ChevronRight as P, ChevronLeft as T } from "../../lib/icons.js";
6
- import { cn as C } from "../../lib/cn.js";
7
- function x(o, r, l) {
8
- return o && (r != null && r[o]) ? r[o] : l;
6
+ import { Spinner as C } from "../spinner.js";
7
+ import { cn as I } from "../../lib/cn.js";
8
+ function x(o, r, i) {
9
+ return o && (r != null && r[o]) ? r[o] : i;
9
10
  }
10
- const I = ({
11
+ const _ = ({
11
12
  iconMap: o,
12
13
  fallbackIcon: r,
13
- emptyLabel: l
14
- }) => /* @__PURE__ */ e(n.Unstable_TriggerPopoverCategories, { children: (i) => /* @__PURE__ */ s(
14
+ emptyLabel: i
15
+ }) => /* @__PURE__ */ e(n.Unstable_TriggerPopoverCategories, { children: (c) => /* @__PURE__ */ s(
15
16
  "div",
16
17
  {
17
18
  "data-slot": "composer-trigger-popover-categories",
18
19
  className: "flex flex-col py-1",
19
20
  children: [
20
- i.map((a) => {
21
- const m = x(a.id, o, r);
21
+ c.map((a) => {
22
+ const l = x(a.id, o, r);
22
23
  return /* @__PURE__ */ s(
23
24
  n.Unstable_TriggerPopoverCategoryItem,
24
25
  {
@@ -26,7 +27,7 @@ const I = ({
26
27
  className: "hover:bg-accent focus:bg-accent data-[highlighted]:bg-accent flex cursor-pointer items-center justify-between gap-2 px-3 py-2 text-sm transition-colors outline-none",
27
28
  children: [
28
29
  /* @__PURE__ */ s("span", { className: "flex items-center gap-2", children: [
29
- /* @__PURE__ */ e(m, { className: "text-muted-foreground size-4" }),
30
+ /* @__PURE__ */ e(l, { className: "text-muted-foreground size-4" }),
30
31
  a.label
31
32
  ] }),
32
33
  /* @__PURE__ */ e(P, { className: "text-muted-foreground size-4" })
@@ -35,17 +36,17 @@ const I = ({
35
36
  a.id
36
37
  );
37
38
  }),
38
- i.length === 0 && /* @__PURE__ */ e("div", { className: "text-muted-foreground px-3 py-2 text-sm", children: l })
39
+ c.length === 0 && /* @__PURE__ */ e("div", { className: "text-muted-foreground px-3 py-2 text-sm", children: i })
39
40
  ]
40
41
  }
41
- ) }), _ = ({
42
+ ) }), U = ({
42
43
  iconMap: o,
43
44
  fallbackIcon: r,
44
- backLabel: l,
45
- emptyLabel: i,
45
+ backLabel: i,
46
+ emptyLabel: c,
46
47
  loadingLabel: a
47
48
  }) => {
48
- const { isLoading: m } = N();
49
+ const { isLoading: l } = N();
49
50
  return /* @__PURE__ */ e(n.Unstable_TriggerPopoverItems, { children: (g) => /* @__PURE__ */ s(
50
51
  "div",
51
52
  {
@@ -54,17 +55,17 @@ const I = ({
54
55
  children: [
55
56
  /* @__PURE__ */ s(n.Unstable_TriggerPopoverBack, { className: "text-muted-foreground hover:bg-accent flex cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs tracking-wide uppercase transition-colors", children: [
56
57
  /* @__PURE__ */ e(T, { className: "size-3.5" }),
57
- l
58
+ i
58
59
  ] }),
59
60
  /* @__PURE__ */ s("div", { className: "py-1", children: [
60
- g.map((t, c) => {
61
+ g.map((t, m) => {
61
62
  var d;
62
63
  const p = typeof ((d = t.metadata) == null ? void 0 : d.icon) == "string" ? t.metadata.icon : void 0, v = x(p, o, r);
63
64
  return /* @__PURE__ */ s(
64
65
  n.Unstable_TriggerPopoverItem,
65
66
  {
66
67
  item: t,
67
- index: c,
68
+ index: m,
68
69
  className: "hover:bg-accent focus:bg-accent data-[highlighted]:bg-accent flex w-full cursor-pointer flex-col items-start gap-0.5 px-3 py-2 text-start transition-colors outline-none",
69
70
  children: [
70
71
  /* @__PURE__ */ s("span", { className: "flex items-center gap-2 text-sm font-medium", children: [
@@ -77,7 +78,17 @@ const I = ({
77
78
  t.id
78
79
  );
79
80
  }),
80
- g.length === 0 && /* @__PURE__ */ e("div", { className: "text-muted-foreground px-3 py-2 text-sm", children: m ? a : i })
81
+ g.length === 0 && /* @__PURE__ */ s(
82
+ "div",
83
+ {
84
+ role: l ? "status" : void 0,
85
+ className: "text-muted-foreground flex items-center gap-2 px-3 py-2 text-sm",
86
+ children: [
87
+ l && /* @__PURE__ */ e(C, { variant: "content", size: "xs", "aria-hidden": !0 }),
88
+ l ? a : c
89
+ ]
90
+ }
91
+ )
81
92
  ] })
82
93
  ]
83
94
  }
@@ -85,19 +96,19 @@ const I = ({
85
96
  }, f = ({
86
97
  iconMap: o,
87
98
  fallbackIcon: r = y,
88
- backLabel: l = "Back",
89
- emptyCategoriesLabel: i = "No items available",
99
+ backLabel: i = "Back",
100
+ emptyCategoriesLabel: c = "No items available",
90
101
  emptyItemsLabel: a = "No matching items",
91
- loadingLabel: m = "Loading…",
102
+ loadingLabel: l = "Loading…",
92
103
  className: g,
93
104
  directive: t,
94
- action: c,
105
+ action: m,
95
106
  ...p
96
107
  }) => (b(!1), /* @__PURE__ */ s(
97
108
  n.Unstable_TriggerPopover,
98
109
  {
99
110
  "data-slot": "composer-trigger-popover",
100
- className: C(
111
+ className: I(
101
112
  "aui-composer-trigger-popover bg-popover text-popover-foreground absolute start-0 bottom-full z-50 mb-2 w-64 overflow-hidden rounded-xl border shadow-lg",
102
113
  g
103
114
  ),
@@ -109,39 +120,39 @@ const I = ({
109
120
  formatter: t.formatter ?? u,
110
121
  onInserted: t.onInserted
111
122
  }
112
- ) : c ? /* @__PURE__ */ e(
123
+ ) : m ? /* @__PURE__ */ e(
113
124
  n.Unstable_TriggerPopover.Action,
114
125
  {
115
- formatter: c.formatter ?? u,
116
- onExecute: c.onExecute,
117
- removeOnExecute: c.removeOnExecute
126
+ formatter: m.formatter ?? u,
127
+ onExecute: m.onExecute,
128
+ removeOnExecute: m.removeOnExecute
118
129
  }
119
130
  ) : null,
120
131
  /* @__PURE__ */ e(
121
- I,
132
+ _,
122
133
  {
123
134
  iconMap: o,
124
135
  fallbackIcon: r,
125
- emptyLabel: i
136
+ emptyLabel: c
126
137
  }
127
138
  ),
128
139
  /* @__PURE__ */ e(
129
- _,
140
+ U,
130
141
  {
131
142
  iconMap: o,
132
143
  fallbackIcon: r,
133
- backLabel: l,
144
+ backLabel: i,
134
145
  emptyLabel: a,
135
- loadingLabel: m
146
+ loadingLabel: l
136
147
  }
137
148
  )
138
149
  ]
139
150
  }
140
151
  ));
141
152
  f.displayName = "ComposerTriggerPopover";
142
- const j = h(
153
+ const S = h(
143
154
  f
144
155
  );
145
156
  export {
146
- j as ComposerTriggerPopover
157
+ S as ComposerTriggerPopover
147
158
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as f, Fragment as M } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as f, Fragment as L } from "react/jsx-runtime";
3
3
  import * as l from "react";
4
- import { useContext as L } from "react";
5
- import { ComposerAttachments as D, ComposerAddImage as I } from "./attachment.js";
4
+ import { useContext as D } from "react";
5
+ import { ComposerAttachments as I, ComposerAddImage as k } from "./attachment.js";
6
6
  import { ComposerAddContext as F } from "./composer-add-context.js";
7
7
  import { ComposerHarness as B } from "./composer-harness.js";
8
8
  import { ComposerQuotePreview as H } from "./quote.js";
@@ -24,27 +24,27 @@ function J(i, t, p, b, T) {
24
24
  } };
25
25
  let w = 0, v, o;
26
26
  return {
27
- promise: new Promise((d) => {
28
- o = d;
27
+ promise: new Promise((u) => {
28
+ o = u;
29
29
  let y = performance.now(), h = null;
30
- const n = (c) => {
30
+ const r = (c) => {
31
31
  if (b()) {
32
- d();
32
+ u();
33
33
  return;
34
34
  }
35
35
  if (T()) {
36
- h === null && (h = c), v = window.setTimeout(() => n(performance.now()), 100);
36
+ h === null && (h = c), v = window.setTimeout(() => r(performance.now()), 100);
37
37
  return;
38
38
  }
39
39
  h !== null && (y += c - h, h = null);
40
- const a = Math.min(1, (c - y) / t), u = a >= 1 ? i.length : Math.floor(a * i.length);
41
- if (p(i.slice(0, u)), a >= 1) {
42
- d();
40
+ const a = Math.min(1, (c - y) / t), d = a >= 1 ? i.length : Math.floor(a * i.length);
41
+ if (p(i.slice(0, d)), a >= 1) {
42
+ u();
43
43
  return;
44
44
  }
45
- w = requestAnimationFrame(n);
45
+ w = requestAnimationFrame(r);
46
46
  };
47
- w = requestAnimationFrame(n);
47
+ w = requestAnimationFrame(r);
48
48
  }),
49
49
  cancel: () => {
50
50
  cancelAnimationFrame(w), v !== void 0 && window.clearTimeout(v), o();
@@ -52,46 +52,46 @@ function J(i, t, p, b, T) {
52
52
  };
53
53
  }
54
54
  const W = () => {
55
- const { setText: i } = q(), t = l.useContext(k), [p, b] = l.useState(
55
+ const { setText: i } = q(), t = l.useContext(M), [p, b] = l.useState(
56
56
  (t == null ? void 0 : t[0]) ?? "Send a message…"
57
- ), [T, w] = l.useState(!1), v = l.useRef(null), [o, z] = l.useState(null), d = l.useRef(!1), y = l.useCallback((n) => {
58
- v.current = n, z(n);
57
+ ), [T, w] = l.useState(!1), v = l.useRef(null), [o, z] = l.useState(null), u = l.useRef(!1), y = l.useCallback((r) => {
58
+ v.current = r, z(r);
59
59
  }, []);
60
60
  l.useEffect(() => {
61
61
  if (!o) return;
62
- let n = 0;
63
- const c = (r) => {
64
- d.current = r || document.activeElement === o, w(r);
62
+ let r = 0;
63
+ const c = (n) => {
64
+ u.current = n || document.activeElement === o, w(n);
65
65
  }, a = () => {
66
- const r = o.value.length > 0;
67
- c(r);
68
- }, u = () => {
69
- window.clearTimeout(n), n = window.setTimeout(a, 0);
66
+ const n = o.value.length > 0;
67
+ c(n);
68
+ }, d = () => {
69
+ window.clearTimeout(r), r = window.setTimeout(a, 0);
70
70
  }, g = () => {
71
- d.current = o.value.length > 0 || document.activeElement === o;
72
- }, E = (r, m) => {
73
- i(r), o.value = r, o.dispatchEvent(new Event("input", { bubbles: !0 })), c(r.length > 0), window.setTimeout(() => {
71
+ u.current = o.value.length > 0 || document.activeElement === o;
72
+ }, E = (n, m) => {
73
+ i(n), o.value = n, o.dispatchEvent(new Event("input", { bubbles: !0 })), c(n.length > 0), window.setTimeout(() => {
74
74
  document.activeElement === o && o.setSelectionRange(m, m);
75
75
  }, 0);
76
- }, P = (r) => {
76
+ }, P = (n) => {
77
77
  const m = o.selectionStart ?? 0, A = o.selectionEnd ?? m;
78
- return m === A || r.inputType !== "deleteContentBackward" && r.inputType !== "deleteContentForward" && r.inputType !== "deleteByCut" ? !1 : (r.preventDefault(), E(
78
+ return m === A || n.inputType !== "deleteContentBackward" && n.inputType !== "deleteContentForward" && n.inputType !== "deleteByCut" ? !1 : (n.preventDefault(), E(
79
79
  o.value.slice(0, m) + o.value.slice(A),
80
80
  m
81
81
  ), !0);
82
- }, C = (r) => {
83
- if (!r.isComposing && !P(r)) {
84
- if (typeof r.data == "string" && r.data.length > 0) {
82
+ }, C = (n) => {
83
+ if (!n.isComposing && !P(n)) {
84
+ if (typeof n.data == "string" && n.data.length > 0) {
85
85
  c(!0);
86
86
  return;
87
87
  }
88
- u();
88
+ d();
89
89
  }
90
- }, x = (r) => {
91
- (r.metaKey || r.ctrlKey) && !r.altKey && r.key.toLowerCase() === "a" && (r.preventDefault(), o.select());
90
+ }, x = (n) => {
91
+ (n.metaKey || n.ctrlKey) && !n.altKey && n.key.toLowerCase() === "a" && (n.preventDefault(), o.select());
92
92
  };
93
93
  return a(), o.addEventListener("beforeinput", C), o.addEventListener("input", a), o.addEventListener("focus", g), o.addEventListener("blur", g), o.addEventListener("keydown", x), () => {
94
- window.clearTimeout(n), o.removeEventListener("beforeinput", C), o.removeEventListener("input", a), o.removeEventListener("focus", g), o.removeEventListener("blur", g), o.removeEventListener("keydown", x);
94
+ window.clearTimeout(r), o.removeEventListener("beforeinput", C), o.removeEventListener("input", a), o.removeEventListener("focus", g), o.removeEventListener("blur", g), o.removeEventListener("keydown", x);
95
95
  };
96
96
  }, [o, i]), l.useEffect(() => {
97
97
  var C;
@@ -103,31 +103,31 @@ const W = () => {
103
103
  b(t[0]);
104
104
  return;
105
105
  }
106
- let n = !1, c = 0, a, u;
107
- const g = (x) => new Promise((r) => {
108
- a = window.setTimeout(r, x);
109
- }), E = () => n;
106
+ let r = !1, c = 0, a, d;
107
+ const g = (x) => new Promise((n) => {
108
+ a = window.setTimeout(n, x);
109
+ }), E = () => r;
110
110
  return (async () => {
111
- for (; !n; ) {
112
- for (; d.current && !n; ) await g(100);
113
- if (n) return;
111
+ for (; !r; ) {
112
+ for (; u.current && !r; ) await g(100);
113
+ if (r) return;
114
114
  const x = t[c];
115
115
  b("");
116
- const { promise: r, cancel: m } = J(
116
+ const { promise: n, cancel: m } = J(
117
117
  x,
118
118
  G(x),
119
119
  b,
120
120
  E,
121
- () => d.current
121
+ () => u.current
122
122
  );
123
- if (u = m, await r, u = void 0, n) return;
124
- if (!d.current) {
125
- if (await g(X), n) return;
123
+ if (d = m, await n, d = void 0, r) return;
124
+ if (!u.current) {
125
+ if (await g(X), r) return;
126
126
  c = (c + 1) % t.length;
127
127
  }
128
128
  }
129
129
  })(), () => {
130
- n = !0, u == null || u(), a && window.clearTimeout(a);
130
+ r = !0, d == null || d(), a && window.clearTimeout(a);
131
131
  };
132
132
  }, [t]);
133
133
  const h = !!(t != null && t.length) && !T;
@@ -153,16 +153,16 @@ const W = () => {
153
153
  }
154
154
  )
155
155
  ] });
156
- }, k = l.createContext(
156
+ }, M = l.createContext(
157
157
  void 0
158
158
  );
159
- function ue({
159
+ function de({
160
160
  prompts: i,
161
161
  children: t
162
162
  }) {
163
- return /* @__PURE__ */ e(k.Provider, { value: i, children: t });
163
+ return /* @__PURE__ */ e(M.Provider, { value: i, children: t });
164
164
  }
165
- const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root animate-in fade-in slide-in-from-bottom-2 fill-mode-both relative flex w-full flex-col duration-(--duration-normal) delay-(--stagger-3)", children: /* @__PURE__ */ e(s.Unstable_TriggerPopoverRoot, { children: /* @__PURE__ */ e(s.AttachmentDropzone, { asChild: !0, children: /* @__PURE__ */ f(
165
+ const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root animate-in fade-in slide-in-from-bottom-2 fill-mode-both relative flex w-full flex-col duration-200 delay-[420ms]", children: /* @__PURE__ */ e(s.Unstable_TriggerPopoverRoot, { children: /* @__PURE__ */ e(s.AttachmentDropzone, { asChild: !0, children: /* @__PURE__ */ f(
166
166
  "div",
167
167
  {
168
168
  "data-slot": "aui_composer-shell",
@@ -170,16 +170,16 @@ const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root anima
170
170
  var p;
171
171
  i.target.closest("button, a, input, textarea, [role='button']") || (p = i.currentTarget.querySelector("textarea")) == null || p.focus();
172
172
  },
173
- className: "border-border/60 data-[dragging=true]:border-ring focus-within:border-border dark:border-muted-foreground/15 dark:focus-within:border-muted-foreground/30 relative flex w-full flex-col gap-2 rounded-(--composer-radius) border bg-(--composer-bg) p-(--composer-padding) shadow-[0_4px_16px_-8px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.04)] transition-[border-color,box-shadow] focus-within:shadow-[0_6px_24px_-8px_rgba(0,0,0,0.12),0_1px_2px_rgba(0,0,0,0.05)] data-[dragging=true]:border-dashed data-[dragging=true]:bg-[color-mix(in_oklab,var(--color-accent)_50%,var(--color-background))] dark:shadow-none",
173
+ className: "border-border/60 data-[dragging=true]:border-ring focus-within:border-border relative flex w-full flex-col gap-2 rounded-(--composer-radius) border bg-(--composer-bg) p-(--composer-padding) shadow-[0_4px_16px_-8px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.04)] transition-[border-color,box-shadow] focus-within:shadow-[0_6px_24px_-8px_rgba(0,0,0,0.12),0_1px_2px_rgba(0,0,0,0.05)] data-[dragging=true]:border-dashed data-[dragging=true]:bg-[color-mix(in_oklab,var(--color-accent)_50%,var(--color-background))]",
174
174
  children: [
175
175
  /* @__PURE__ */ e(H, { className: "mx-0 mt-0" }),
176
- /* @__PURE__ */ e(D, {}),
176
+ /* @__PURE__ */ e(I, {}),
177
177
  /* @__PURE__ */ e(W, {}),
178
178
  /* @__PURE__ */ e(Z, {})
179
179
  ]
180
180
  }
181
181
  ) }) }) }), Z = () => {
182
- const { ComposerAccessories: i = $ } = L(K);
182
+ const { ComposerAccessories: i = $ } = D(K);
183
183
  return /* @__PURE__ */ f("div", { className: "aui-composer-action-wrapper relative flex items-center justify-between", children: [
184
184
  /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ e(i, {}) }),
185
185
  /* @__PURE__ */ f("div", { className: "flex items-center gap-1.5", children: [
@@ -237,16 +237,16 @@ const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root anima
237
237
  ) }) })
238
238
  ] })
239
239
  ] });
240
- }, $ = () => /* @__PURE__ */ f(M, { children: [
240
+ }, $ = () => /* @__PURE__ */ f(L, { children: [
241
241
  /* @__PURE__ */ e(F, {}),
242
- /* @__PURE__ */ e(I, {}),
242
+ /* @__PURE__ */ e(k, {}),
243
243
  /* @__PURE__ */ e(B, {})
244
244
  ] }), pe = () => /* @__PURE__ */ e(
245
245
  j.Root,
246
246
  {
247
247
  "data-slot": "aui_edit-composer-wrapper",
248
248
  className: "flex flex-col px-2 [contain-intrinsic-size:auto_200px] [content-visibility:auto]",
249
- children: /* @__PURE__ */ f(s.Root, { className: "aui-edit-composer-root border-border/60 dark:border-muted-foreground/15 ms-auto flex w-full max-w-[85%] flex-col rounded-(--composer-radius) border bg-(--composer-bg) shadow-[0_4px_16px_-8px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.04)] dark:shadow-none", children: [
249
+ children: /* @__PURE__ */ f(s.Root, { className: "aui-edit-composer-root border-border/60 ms-auto flex w-full max-w-[85%] flex-col rounded-(--composer-radius) border bg-(--composer-bg) shadow-[0_4px_16px_-8px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.04)]", children: [
250
250
  /* @__PURE__ */ e(
251
251
  s.Input,
252
252
  {
@@ -271,6 +271,6 @@ const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root anima
271
271
  );
272
272
  export {
273
273
  me as Composer,
274
- ue as ComposerPlaceholdersProvider,
274
+ de as ComposerPlaceholdersProvider,
275
275
  pe as EditComposer
276
276
  };
@@ -1,39 +1,39 @@
1
1
  "use client";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
- import { ErrorPrimitive as o, MessagePrimitive as i } from "@assistant-ui/react";
3
+ import { ErrorPrimitive as t, MessagePrimitive as a } from "@assistant-ui/react";
4
4
  import { cn as s } from "../../lib/cn.js";
5
- function a({
5
+ function i({
6
6
  className: e,
7
- ...t
7
+ ...o
8
8
  }) {
9
9
  return /* @__PURE__ */ r(
10
- o.Root,
10
+ t.Root,
11
11
  {
12
12
  "data-slot": "error-root",
13
13
  className: s(
14
- "aui-message-error-root border-destructive bg-destructive/10 text-destructive dark:bg-destructive/5 mt-2 rounded-md border p-3 text-xs dark:text-red-200",
14
+ "aui-message-error-root mt-2 rounded-md border border-danger-100 bg-danger-50 p-3 text-xs text-danger-700",
15
15
  e
16
16
  ),
17
- ...t
17
+ ...o
18
18
  }
19
19
  );
20
20
  }
21
- function d({
21
+ function n({
22
22
  className: e,
23
- ...t
23
+ ...o
24
24
  }) {
25
25
  return /* @__PURE__ */ r(
26
- o.Message,
26
+ t.Message,
27
27
  {
28
28
  "data-slot": "error-text",
29
29
  className: s("aui-message-error-message line-clamp-2", e),
30
- ...t
30
+ ...o
31
31
  }
32
32
  );
33
33
  }
34
- const u = () => /* @__PURE__ */ r(i.Error, { children: /* @__PURE__ */ r(a, { children: /* @__PURE__ */ r(d, {}) }) });
34
+ const g = () => /* @__PURE__ */ r(a.Error, { children: /* @__PURE__ */ r(i, { children: /* @__PURE__ */ r(n, {}) }) });
35
35
  export {
36
- a as ErrorRoot,
37
- d as ErrorText,
38
- u as MessageError
36
+ i as ErrorRoot,
37
+ n as ErrorText,
38
+ g as MessageError
39
39
  };
@@ -2,7 +2,7 @@ import { FC } from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  import { FileMessagePartComponent } from '@assistant-ui/react';
4
4
  declare const fileVariants: (props?: ({
5
- variant?: "muted" | "outline" | "ghost" | null | undefined;
5
+ variant?: "outline" | "muted" | "ghost" | null | undefined;
6
6
  size?: "default" | "sm" | "lg" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
8
  declare function getMimeTypeIcon(mimeType: string): FC<{
@@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  import { ImageMessagePart, ImageMessagePartComponent } from '@assistant-ui/react';
4
4
  declare const imageVariants: (props?: ({
5
- variant?: "muted" | "outline" | "ghost" | null | undefined;
5
+ variant?: "outline" | "muted" | "ghost" | null | undefined;
6
6
  size?: "default" | "sm" | "lg" | "full" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
8
  export type ImageRootProps = React.ComponentProps<"div"> & VariantProps<typeof imageVariants>;