@actioneer/ads 0.2.4 → 0.3.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.
- package/components/ai-elements/chain-of-thought.d.ts +88 -6
- package/components/ai-elements/chain-of-thought.js +370 -107
- package/components/ai-elements/chart.d.ts +30 -0
- package/components/ai-elements/chart.js +303 -0
- package/components/ai-elements/index.d.ts +2 -0
- package/components/ai-elements/message.d.ts +12 -2
- package/components/ai-elements/message.js +133 -100
- package/components/ai-elements/research-activity.d.ts +62 -0
- package/components/ai-elements/research-activity.js +278 -0
- package/components/ai-elements/task.d.ts +7 -3
- package/components/ai-elements/task.js +84 -52
- package/components/ai-elements/tool.js +39 -35
- package/components/ai-elements/voice.d.ts +7 -1
- package/components/ai-elements/voice.js +234 -180
- package/components/alert.js +28 -16
- package/components/answer.d.ts +16 -0
- package/components/answer.js +273 -249
- package/components/assistant-ui/attachment.js +5 -1
- package/components/assistant-ui/composer-deep-research.js +44 -29
- package/components/assistant-ui/composer-harness.js +45 -27
- package/components/assistant-ui/composer.js +16 -16
- package/components/assistant-ui/index.d.ts +0 -1
- package/components/assistant-ui/message.d.ts +7 -0
- package/components/assistant-ui/message.js +36 -36
- package/components/assistant-ui/thread.js +1 -1
- package/components/brand-texture.d.ts +37 -0
- package/components/brand-texture.js +54 -0
- package/components/code-block.d.ts +42 -0
- package/components/code-block.js +235 -0
- package/components/drawer.d.ts +1 -1
- package/components/file-dropzone.d.ts +32 -0
- package/components/file-dropzone.js +134 -0
- package/components/index.d.ts +10 -0
- package/components/index.js +482 -433
- package/components/infinite-canvas.d.ts +50 -0
- package/components/infinite-canvas.js +215 -0
- package/components/page-header.d.ts +22 -0
- package/components/page-header.js +52 -0
- package/components/resizable-panel.d.ts +29 -0
- package/components/resizable-panel.js +102 -0
- package/components/reveal.d.ts +36 -0
- package/components/reveal.js +35 -0
- package/components/scroll-area.d.ts +19 -0
- package/components/scroll-area.js +57 -0
- package/components/setting-row.d.ts +35 -0
- package/components/setting-row.js +86 -0
- package/components/sidebar.js +131 -131
- package/components/stepper.d.ts +40 -0
- package/components/stepper.js +102 -0
- package/components/table.js +16 -15
- package/components/tabs.js +1 -1
- package/lib/icons.d.ts +12 -0
- package/lib/icons.js +98 -95
- package/lib/motion.d.ts +7 -3
- package/lib/motion.js +29 -27
- package/llms.txt +123 -28
- package/manifest.json +883 -68
- package/package.json +2 -2
- package/styles.css +179 -30
- package/theme.css +29 -17
- package/components/assistant-ui/smart-message-text.d.ts +0 -15
- package/components/assistant-ui/smart-message-text.js +0 -29
|
@@ -1,172 +1,435 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { Collapsible as
|
|
5
|
-
import { ChevronRight as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { memo as
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { jsx as e, jsxs as c, Fragment as R } from "react/jsx-runtime";
|
|
3
|
+
import { Badge as y } from "../badge.js";
|
|
4
|
+
import { Collapsible as N, CollapsibleTrigger as C, CollapsibleContent as T } from "../collapsible.js";
|
|
5
|
+
import { ChevronRight as M, ChevronDown as w, WarningCircle as j, Database as _ } from "../../lib/icons.js";
|
|
6
|
+
import { cn as n } from "../../lib/cn.js";
|
|
7
|
+
import { createContext as O, memo as l, useContext as S, useState as D, useRef as A, useEffect as I } from "react";
|
|
8
|
+
import { motion as L } from "motion/react";
|
|
9
|
+
import { EASE_DISCLOSURE as P } from "../../lib/motion.js";
|
|
10
|
+
const k = O(!1), E = O("rail"), B = l(
|
|
11
|
+
({
|
|
12
|
+
className: i,
|
|
13
|
+
role: o = "list",
|
|
14
|
+
connector: r = "rail",
|
|
15
|
+
children: a,
|
|
16
|
+
...t
|
|
17
|
+
}) => /* @__PURE__ */ e(
|
|
10
18
|
"div",
|
|
11
19
|
{
|
|
12
20
|
"data-slot": "chain-of-thought",
|
|
13
|
-
role:
|
|
14
|
-
className:
|
|
21
|
+
role: o,
|
|
22
|
+
className: n(
|
|
15
23
|
"w-full",
|
|
16
|
-
"[
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
r === "rail" && [
|
|
25
|
+
"[&>[data-slot=chain-of-thought-step]:not(:has(~_[data-slot=chain-of-thought-step]))]:pb-0",
|
|
26
|
+
"[&>[data-slot=chain-of-thought-step]:not(:has(~_[data-slot=chain-of-thought-step]))]:before:hidden"
|
|
27
|
+
],
|
|
28
|
+
i
|
|
19
29
|
),
|
|
20
|
-
...t
|
|
30
|
+
...t,
|
|
31
|
+
children: /* @__PURE__ */ e(E.Provider, { value: r, children: a })
|
|
21
32
|
}
|
|
22
33
|
)
|
|
23
|
-
),
|
|
34
|
+
), F = l(
|
|
24
35
|
({
|
|
25
|
-
className:
|
|
26
|
-
defaultOpen:
|
|
36
|
+
className: i,
|
|
37
|
+
defaultOpen: o,
|
|
38
|
+
open: r,
|
|
39
|
+
onOpenChange: a,
|
|
27
40
|
status: t = "complete",
|
|
28
|
-
role:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
role: s = "listitem",
|
|
42
|
+
"aria-busy": h,
|
|
43
|
+
children: m,
|
|
44
|
+
...d
|
|
45
|
+
}) => {
|
|
46
|
+
const p = S(E), u = r !== void 0, [g, f] = D(
|
|
47
|
+
o ?? t === "active"
|
|
48
|
+
), b = A(t), z = b.current !== "active" && t === "active", v = u ? r : z || g;
|
|
49
|
+
return I(() => {
|
|
50
|
+
const x = b.current;
|
|
51
|
+
b.current = t, !(x === "active" || t !== "active") && (u || f(!0), a == null || a(!0));
|
|
52
|
+
}, [u, a, t]), /* @__PURE__ */ e(
|
|
53
|
+
N,
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "chain-of-thought-step",
|
|
56
|
+
"data-status": t,
|
|
57
|
+
open: v,
|
|
58
|
+
onOpenChange: (x) => {
|
|
59
|
+
u || f(x), a == null || a(x);
|
|
60
|
+
},
|
|
61
|
+
role: s,
|
|
62
|
+
"aria-current": t === "active" ? "step" : void 0,
|
|
63
|
+
"aria-busy": h ?? (t === "active" || void 0),
|
|
64
|
+
className: n(
|
|
65
|
+
"group/cot-step relative pb-2",
|
|
66
|
+
// Connector rail: a 16px segment centred in the 28px gap between a
|
|
67
|
+
// collapsed step's icon and the next one (top-8 = 32px from the step
|
|
68
|
+
// top, ending 4px past its box). It stretches with an open step.
|
|
69
|
+
p === "rail" && "before:absolute before:top-8 before:-bottom-1 before:left-2 before:w-px before:bg-border before:content-['']",
|
|
70
|
+
// Tree connector: a continuous rail down the group with an elbow
|
|
71
|
+
// reaching EVERY step — the same branch language as Tree/TreeItem.
|
|
72
|
+
// The last step drops the rail; its elbow draws the final segment.
|
|
73
|
+
p === "tree" && [
|
|
74
|
+
"ps-5",
|
|
75
|
+
"before:absolute before:inset-y-0 before:left-0 before:border-l before:border-border before:content-['']",
|
|
76
|
+
"last:before:hidden",
|
|
77
|
+
// top-0.5 + h-4 lands the elbow at 18px — the step icon's centre.
|
|
78
|
+
"after:absolute after:left-0 after:top-0.5 after:h-4 after:w-4 after:rounded-bl-[9px] after:border-b after:border-l after:border-border after:content-['']"
|
|
79
|
+
],
|
|
80
|
+
t === "complete" && "text-secondary",
|
|
81
|
+
t === "active" && "text-primary",
|
|
82
|
+
t === "pending" && "text-tertiary/60",
|
|
83
|
+
t === "error" && "text-danger",
|
|
84
|
+
i
|
|
85
|
+
),
|
|
86
|
+
...d,
|
|
87
|
+
children: /* @__PURE__ */ e(k.Provider, { value: v, children: m })
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
), U = l(
|
|
50
92
|
({
|
|
51
|
-
className:
|
|
52
|
-
children:
|
|
53
|
-
leftIcon:
|
|
54
|
-
endContent:
|
|
93
|
+
className: i,
|
|
94
|
+
children: o,
|
|
95
|
+
leftIcon: r,
|
|
96
|
+
endContent: a,
|
|
97
|
+
caret: t = !0,
|
|
55
98
|
swapIconOnHover: s = !0,
|
|
56
99
|
...h
|
|
57
|
-
}) => /* @__PURE__ */
|
|
100
|
+
}) => /* @__PURE__ */ e(C, { asChild: !0, ...h, children: /* @__PURE__ */ c(
|
|
58
101
|
"button",
|
|
59
102
|
{
|
|
60
103
|
type: "button",
|
|
61
104
|
"data-slot": "chain-of-thought-trigger",
|
|
62
|
-
className:
|
|
105
|
+
className: n(
|
|
63
106
|
"group/cot-trigger flex min-h-9 w-full cursor-pointer items-center gap-3 rounded-sm text-left text-base text-current outline-none",
|
|
107
|
+
// Rows carry no hover fill: the caret is the affordance, and a filled
|
|
108
|
+
// band on every row makes a dense trace read as a list of buttons.
|
|
64
109
|
"transition-colors duration-(--duration-fast) ease-out hover:text-primary",
|
|
65
110
|
"focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none",
|
|
66
|
-
|
|
111
|
+
i
|
|
67
112
|
),
|
|
68
113
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ e(
|
|
70
115
|
"span",
|
|
71
116
|
{
|
|
72
117
|
"aria-hidden": !0,
|
|
73
118
|
className: "relative z-10 block size-4 shrink-0",
|
|
74
|
-
children:
|
|
75
|
-
/* @__PURE__ */
|
|
119
|
+
children: r ? /* @__PURE__ */ c(R, { children: [
|
|
120
|
+
/* @__PURE__ */ e(
|
|
76
121
|
"span",
|
|
77
122
|
{
|
|
78
|
-
className:
|
|
123
|
+
className: n(
|
|
79
124
|
"absolute inset-0 flex items-center justify-center transition-opacity duration-(--duration-fast) ease-out [&>svg]:size-4 motion-reduce:transition-none",
|
|
80
|
-
s && "group-hover/cot-trigger:opacity-0 group-data-[state=open]/cot-trigger:opacity-0"
|
|
125
|
+
!t && s && "group-hover/cot-trigger:opacity-0 group-data-[state=open]/cot-trigger:opacity-0"
|
|
81
126
|
),
|
|
82
|
-
children:
|
|
127
|
+
children: r
|
|
83
128
|
}
|
|
84
129
|
),
|
|
85
|
-
s && /* @__PURE__ */
|
|
86
|
-
|
|
130
|
+
!t && s && /* @__PURE__ */ e(
|
|
131
|
+
M,
|
|
87
132
|
{
|
|
88
|
-
className:
|
|
133
|
+
className: n(
|
|
89
134
|
"absolute inset-0 size-4 opacity-0 transition-[opacity,transform] duration-(--duration-fast) ease-out motion-reduce:transition-none",
|
|
90
135
|
"group-hover/cot-trigger:opacity-100 group-data-[state=open]/cot-trigger:opacity-100",
|
|
91
136
|
"group-data-[state=open]/cot-trigger:rotate-90"
|
|
92
137
|
)
|
|
93
138
|
}
|
|
94
139
|
)
|
|
95
|
-
] }) : /* @__PURE__ */
|
|
140
|
+
] }) : /* @__PURE__ */ e("span", { className: "absolute top-1/2 left-1/2 size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-dot bg-current" })
|
|
96
141
|
}
|
|
97
142
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
143
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: o }),
|
|
144
|
+
/* @__PURE__ */ c("span", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
145
|
+
a != null && /* @__PURE__ */ e("span", { className: "text-xs text-tertiary tabular-nums", children: a }),
|
|
146
|
+
t && /* @__PURE__ */ e(
|
|
147
|
+
w,
|
|
148
|
+
{
|
|
149
|
+
className: "size-4 shrink-0 text-tertiary transition-transform duration-(--duration-fast) ease-out group-data-[state=open]/cot-trigger:rotate-180 motion-reduce:transition-none",
|
|
150
|
+
"aria-hidden": !0
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
] })
|
|
100
154
|
]
|
|
101
155
|
}
|
|
102
156
|
) })
|
|
103
|
-
),
|
|
104
|
-
({ className:
|
|
105
|
-
|
|
106
|
-
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
157
|
+
), W = l(
|
|
158
|
+
({ className: i, children: o, ...r }) => {
|
|
159
|
+
const a = S(k);
|
|
160
|
+
return /* @__PURE__ */ e(T, { forceMount: !0, asChild: !0, ...r, children: /* @__PURE__ */ e(
|
|
161
|
+
L.div,
|
|
162
|
+
{
|
|
163
|
+
"data-slot": "chain-of-thought-content",
|
|
164
|
+
initial: !1,
|
|
165
|
+
animate: a ? "open" : "closed",
|
|
166
|
+
variants: {
|
|
167
|
+
open: { height: "auto", opacity: 1 },
|
|
168
|
+
closed: { height: 0, opacity: 0 }
|
|
169
|
+
},
|
|
170
|
+
transition: { duration: a ? 0.28 : 0.2, ease: P },
|
|
171
|
+
className: n(
|
|
172
|
+
"overflow-hidden text-foreground outline-none",
|
|
173
|
+
"data-[state=closed]:pointer-events-none",
|
|
174
|
+
i
|
|
175
|
+
),
|
|
176
|
+
children: /* @__PURE__ */ e("div", { className: "pt-2 pb-1 pl-7", children: o })
|
|
177
|
+
}
|
|
178
|
+
) });
|
|
179
|
+
}
|
|
180
|
+
), X = l(
|
|
181
|
+
({ className: i, ...o }) => /* @__PURE__ */ e(
|
|
119
182
|
"div",
|
|
120
183
|
{
|
|
121
184
|
"data-slot": "chain-of-thought-item",
|
|
122
|
-
className:
|
|
185
|
+
className: n(
|
|
123
186
|
"relative pl-4 text-base text-secondary",
|
|
124
187
|
"before:absolute before:top-2 before:left-0 before:size-1.5 before:rounded-dot before:bg-current before:content-['']",
|
|
125
|
-
|
|
188
|
+
i
|
|
126
189
|
),
|
|
127
|
-
...
|
|
190
|
+
...o
|
|
128
191
|
}
|
|
129
192
|
)
|
|
130
|
-
),
|
|
131
|
-
({ className:
|
|
193
|
+
), q = l(
|
|
194
|
+
({ className: i, ...o }) => /* @__PURE__ */ e(
|
|
132
195
|
"div",
|
|
133
196
|
{
|
|
134
|
-
className:
|
|
135
|
-
...
|
|
197
|
+
className: n("flex flex-wrap items-center gap-2", i),
|
|
198
|
+
...o
|
|
136
199
|
}
|
|
137
200
|
)
|
|
138
|
-
),
|
|
139
|
-
({ className:
|
|
140
|
-
|
|
201
|
+
), G = l(
|
|
202
|
+
({ className: i, children: o, ...r }) => /* @__PURE__ */ e(
|
|
203
|
+
y,
|
|
141
204
|
{
|
|
142
|
-
className:
|
|
205
|
+
className: n("gap-1 font-normal", i),
|
|
143
206
|
color: "default",
|
|
144
207
|
variant: "soft",
|
|
145
|
-
...
|
|
146
|
-
children:
|
|
208
|
+
...r,
|
|
209
|
+
children: o
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
), J = l(
|
|
213
|
+
({
|
|
214
|
+
className: i,
|
|
215
|
+
title: o,
|
|
216
|
+
tag: r,
|
|
217
|
+
meta: a,
|
|
218
|
+
source: t,
|
|
219
|
+
error: s,
|
|
220
|
+
icon: h,
|
|
221
|
+
defaultOpen: m = !1,
|
|
222
|
+
children: d,
|
|
223
|
+
...p
|
|
224
|
+
}) => /* @__PURE__ */ c(
|
|
225
|
+
N,
|
|
226
|
+
{
|
|
227
|
+
"data-slot": "chain-of-thought-evidence",
|
|
228
|
+
"data-error": s != null || void 0,
|
|
229
|
+
defaultOpen: m,
|
|
230
|
+
className: n("w-full", i),
|
|
231
|
+
...p,
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ c(
|
|
234
|
+
"button",
|
|
235
|
+
{
|
|
236
|
+
type: "button",
|
|
237
|
+
"data-slot": "chain-of-thought-evidence-trigger",
|
|
238
|
+
className: n(
|
|
239
|
+
"group/cot-evidence flex min-h-8 w-full cursor-pointer items-center gap-2 rounded-md text-left outline-none",
|
|
240
|
+
"transition-colors duration-(--duration-fast) ease-out hover:text-primary",
|
|
241
|
+
"focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none"
|
|
242
|
+
),
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ e(
|
|
245
|
+
"span",
|
|
246
|
+
{
|
|
247
|
+
"aria-hidden": !0,
|
|
248
|
+
className: n(
|
|
249
|
+
"shrink-0 [&>svg]:size-3.5",
|
|
250
|
+
s != null ? "text-danger" : "text-tertiary"
|
|
251
|
+
),
|
|
252
|
+
children: h ?? (s != null ? /* @__PURE__ */ e(j, {}) : /* @__PURE__ */ e(_, {}))
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-sm font-medium text-secondary", children: o }),
|
|
256
|
+
r != null && /* @__PURE__ */ e(
|
|
257
|
+
y,
|
|
258
|
+
{
|
|
259
|
+
color: "default",
|
|
260
|
+
variant: "soft",
|
|
261
|
+
className: "shrink-0 font-normal tabular-nums",
|
|
262
|
+
children: r
|
|
263
|
+
}
|
|
264
|
+
),
|
|
265
|
+
a != null && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-tertiary tabular-nums", children: a }),
|
|
266
|
+
/* @__PURE__ */ e(
|
|
267
|
+
w,
|
|
268
|
+
{
|
|
269
|
+
"aria-hidden": !0,
|
|
270
|
+
className: n(
|
|
271
|
+
"size-3.5 shrink-0 text-tertiary transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none",
|
|
272
|
+
"group-data-[state=open]/cot-evidence:rotate-180"
|
|
273
|
+
)
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
) }),
|
|
279
|
+
/* @__PURE__ */ e(
|
|
280
|
+
T,
|
|
281
|
+
{
|
|
282
|
+
"data-slot": "chain-of-thought-evidence-content",
|
|
283
|
+
className: n(
|
|
284
|
+
"overflow-hidden outline-none",
|
|
285
|
+
"data-[state=closed]:pointer-events-none data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none"
|
|
286
|
+
),
|
|
287
|
+
children: /* @__PURE__ */ c("div", { className: "flex flex-col gap-1.5 pt-1.5", children: [
|
|
288
|
+
s != null && /* @__PURE__ */ e("p", { className: "text-xs text-danger", children: s }),
|
|
289
|
+
d,
|
|
290
|
+
t != null && /* @__PURE__ */ e("p", { className: "text-xs text-tertiary", children: t })
|
|
291
|
+
] })
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
)
|
|
297
|
+
), K = l(
|
|
298
|
+
({
|
|
299
|
+
className: i,
|
|
300
|
+
columns: o,
|
|
301
|
+
rows: r,
|
|
302
|
+
totalRows: a,
|
|
303
|
+
flag: t,
|
|
304
|
+
...s
|
|
305
|
+
}) => {
|
|
306
|
+
const h = a != null && a > r.length, m = (t == null ? void 0 : t.color) ?? "default";
|
|
307
|
+
return /* @__PURE__ */ c(
|
|
308
|
+
"div",
|
|
309
|
+
{
|
|
310
|
+
"data-slot": "chain-of-thought-evidence-table",
|
|
311
|
+
className: n("overflow-hidden rounded-lg bg-surface", i),
|
|
312
|
+
...s,
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ e("div", { className: "max-h-56 overflow-auto", children: /* @__PURE__ */ c("table", { className: "w-full border-collapse text-xs tabular-nums", children: [
|
|
315
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "text-tertiary", children: o.map((d) => /* @__PURE__ */ e(
|
|
316
|
+
"th",
|
|
317
|
+
{
|
|
318
|
+
className: n(
|
|
319
|
+
"sticky top-0 bg-surface px-2.5 py-1.5 font-medium whitespace-nowrap",
|
|
320
|
+
d.align === "end" ? "text-right" : "text-left"
|
|
321
|
+
),
|
|
322
|
+
children: d.label
|
|
323
|
+
},
|
|
324
|
+
d.key
|
|
325
|
+
)) }) }),
|
|
326
|
+
/* @__PURE__ */ e("tbody", { children: r.map((d, p) => {
|
|
327
|
+
const u = t != null && String(d[t.key]) === String(t.value);
|
|
328
|
+
return /* @__PURE__ */ e("tr", { className: n(u && "bg-muted"), children: o.map((g, f) => /* @__PURE__ */ e(
|
|
329
|
+
"td",
|
|
330
|
+
{
|
|
331
|
+
className: n(
|
|
332
|
+
"px-2.5 py-1 whitespace-nowrap",
|
|
333
|
+
g.align === "end" ? "text-right" : "text-left",
|
|
334
|
+
f === 0 ? "text-foreground" : "text-secondary",
|
|
335
|
+
u && f === 0 && "font-semibold",
|
|
336
|
+
u && f === 0 && m === "danger" && "text-danger",
|
|
337
|
+
u && f === 0 && m === "warning" && "text-warning"
|
|
338
|
+
),
|
|
339
|
+
children: d[g.key]
|
|
340
|
+
},
|
|
341
|
+
g.key
|
|
342
|
+
)) }, p);
|
|
343
|
+
}) })
|
|
344
|
+
] }) }),
|
|
345
|
+
h && /* @__PURE__ */ c("p", { className: "px-2.5 py-1.5 text-xs text-tertiary tabular-nums", children: [
|
|
346
|
+
r.length,
|
|
347
|
+
" of ",
|
|
348
|
+
a,
|
|
349
|
+
" rows"
|
|
350
|
+
] })
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
), Q = l(
|
|
356
|
+
({ className: i, role: o = "list", ...r }) => /* @__PURE__ */ e(
|
|
357
|
+
"div",
|
|
358
|
+
{
|
|
359
|
+
"data-slot": "chain-of-thought-metrics",
|
|
360
|
+
role: o,
|
|
361
|
+
className: n("flex flex-wrap items-stretch gap-x-6 gap-y-2", i),
|
|
362
|
+
...r
|
|
363
|
+
}
|
|
364
|
+
)
|
|
365
|
+
), V = {
|
|
366
|
+
default: "text-foreground",
|
|
367
|
+
danger: "text-danger",
|
|
368
|
+
warning: "text-warning",
|
|
369
|
+
success: "text-success",
|
|
370
|
+
info: "text-info"
|
|
371
|
+
}, Y = l(
|
|
372
|
+
({
|
|
373
|
+
className: i,
|
|
374
|
+
label: o,
|
|
375
|
+
value: r,
|
|
376
|
+
sub: a,
|
|
377
|
+
color: t = "default",
|
|
378
|
+
role: s = "listitem",
|
|
379
|
+
...h
|
|
380
|
+
}) => /* @__PURE__ */ c(
|
|
381
|
+
"div",
|
|
382
|
+
{
|
|
383
|
+
"data-slot": "chain-of-thought-metric",
|
|
384
|
+
"data-color": t,
|
|
385
|
+
role: s,
|
|
386
|
+
className: n("min-w-0", i),
|
|
387
|
+
...h,
|
|
388
|
+
children: [
|
|
389
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-tertiary", children: o }),
|
|
390
|
+
/* @__PURE__ */ e(
|
|
391
|
+
"div",
|
|
392
|
+
{
|
|
393
|
+
className: n(
|
|
394
|
+
"text-base font-semibold tabular-nums",
|
|
395
|
+
V[t]
|
|
396
|
+
),
|
|
397
|
+
children: r
|
|
398
|
+
}
|
|
399
|
+
),
|
|
400
|
+
a != null && /* @__PURE__ */ e("div", { className: "text-xs text-tertiary", children: a })
|
|
401
|
+
]
|
|
147
402
|
}
|
|
148
403
|
)
|
|
149
|
-
),
|
|
150
|
-
({ className:
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
|
|
404
|
+
), Z = l(
|
|
405
|
+
({ className: i, children: o, caption: r, ...a }) => /* @__PURE__ */ c("div", { className: n("space-y-2", i), ...a, children: [
|
|
406
|
+
/* @__PURE__ */ e("div", { className: "relative flex max-h-88 items-center justify-center overflow-hidden rounded-lg bg-muted p-3", children: o }),
|
|
407
|
+
r && /* @__PURE__ */ e("p", { className: "text-xs text-tertiary", children: r })
|
|
153
408
|
] })
|
|
154
409
|
);
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
410
|
+
B.displayName = "ChainOfThought";
|
|
411
|
+
F.displayName = "ChainOfThoughtStep";
|
|
412
|
+
U.displayName = "ChainOfThoughtTrigger";
|
|
413
|
+
W.displayName = "ChainOfThoughtContent";
|
|
414
|
+
X.displayName = "ChainOfThoughtItem";
|
|
415
|
+
q.displayName = "ChainOfThoughtSearchResults";
|
|
416
|
+
G.displayName = "ChainOfThoughtSearchResult";
|
|
417
|
+
J.displayName = "ChainOfThoughtEvidence";
|
|
418
|
+
K.displayName = "ChainOfThoughtEvidenceTable";
|
|
419
|
+
Q.displayName = "ChainOfThoughtMetrics";
|
|
420
|
+
Y.displayName = "ChainOfThoughtMetric";
|
|
421
|
+
Z.displayName = "ChainOfThoughtImage";
|
|
163
422
|
export {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
423
|
+
B as ChainOfThought,
|
|
424
|
+
W as ChainOfThoughtContent,
|
|
425
|
+
J as ChainOfThoughtEvidence,
|
|
426
|
+
K as ChainOfThoughtEvidenceTable,
|
|
427
|
+
Z as ChainOfThoughtImage,
|
|
428
|
+
X as ChainOfThoughtItem,
|
|
429
|
+
Y as ChainOfThoughtMetric,
|
|
430
|
+
Q as ChainOfThoughtMetrics,
|
|
431
|
+
G as ChainOfThoughtSearchResult,
|
|
432
|
+
q as ChainOfThoughtSearchResults,
|
|
433
|
+
F as ChainOfThoughtStep,
|
|
434
|
+
U as ChainOfThoughtTrigger
|
|
172
435
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare const aiChartVariants: (props?: ({
|
|
4
|
+
status?: "error" | "pending" | "querying" | "partial" | "rendering" | "ready" | "cancelled" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export type AIChartStatus = NonNullable<VariantProps<typeof aiChartVariants>["status"]>;
|
|
7
|
+
export interface AIChartProgress {
|
|
8
|
+
received: number;
|
|
9
|
+
total?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface AIChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "title">, VariantProps<typeof aiChartVariants> {
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
tag?: React.ReactNode;
|
|
14
|
+
source?: string;
|
|
15
|
+
progress?: AIChartProgress;
|
|
16
|
+
/** Consumer-formatted elapsed time, for example `0:36` or `3:42`. */
|
|
17
|
+
elapsed?: string;
|
|
18
|
+
/** Replaces the status/progress metadata at the end of the trigger row. */
|
|
19
|
+
meta?: React.ReactNode;
|
|
20
|
+
/** Concise nonvisual summary of the chart's result and important values. */
|
|
21
|
+
accessibleSummary?: React.ReactNode;
|
|
22
|
+
open?: boolean;
|
|
23
|
+
defaultOpen?: boolean;
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
onSourceSelect?: (source: string) => void;
|
|
26
|
+
errorContent?: React.ReactNode;
|
|
27
|
+
onRetry?: () => void;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare const AIChart: React.ForwardRefExoticComponent<AIChartProps & React.RefAttributes<HTMLDivElement>>;
|