@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
package/components/answer.js
CHANGED
|
@@ -1,170 +1,180 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { z as
|
|
6
|
-
import { Alert as
|
|
7
|
-
import { Badge as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { FollowUpSuggestion as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import * as u from "react";
|
|
4
|
+
import { cva as L } from "class-variance-authority";
|
|
5
|
+
import { z as e } from "zod/v4";
|
|
6
|
+
import { Alert as E, AlertTitle as B, AlertDescription as $ } from "./alert.js";
|
|
7
|
+
import { Badge as p } from "./badge.js";
|
|
8
|
+
import { Button as z } from "./button.js";
|
|
9
|
+
import { FollowUpSuggestion as O } from "./assistant-ui/follow-up-suggestions.js";
|
|
10
|
+
import { Source as P, SourceTitle as V } from "./assistant-ui/sources.js";
|
|
11
|
+
import { AreaChart as _, BarChart as M, LineChart as W } from "./chart.js";
|
|
12
|
+
import { Progress as I } from "./progress.js";
|
|
12
13
|
import { cn as c } from "../lib/cn.js";
|
|
13
|
-
const
|
|
14
|
+
const K = "render_answer", H = "Render the final answer with one curated ADS template. Choose the semantic kind that best matches the answer and provide only validated data; the application owns the layout.", x = e.enum([
|
|
14
15
|
"default",
|
|
15
16
|
"primary",
|
|
16
17
|
"success",
|
|
17
18
|
"warning",
|
|
18
19
|
"danger",
|
|
19
20
|
"info"
|
|
20
|
-
]),
|
|
21
|
-
id:
|
|
22
|
-
label:
|
|
23
|
-
prompt:
|
|
24
|
-
}),
|
|
25
|
-
id:
|
|
26
|
-
label:
|
|
27
|
-
description:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
]), F = e.object({
|
|
22
|
+
id: e.string().min(1),
|
|
23
|
+
label: e.string().min(1),
|
|
24
|
+
prompt: e.string().min(1).optional()
|
|
25
|
+
}), q = e.object({
|
|
26
|
+
id: e.string().min(1),
|
|
27
|
+
label: e.string().min(1),
|
|
28
|
+
description: e.string().optional(),
|
|
29
|
+
href: e.string().min(1).refine((t) => {
|
|
30
|
+
if (t.startsWith("/") || t.startsWith("#")) return !0;
|
|
31
|
+
try {
|
|
32
|
+
const r = new URL(t).protocol;
|
|
33
|
+
return r === "http:" || r === "https:";
|
|
34
|
+
} catch {
|
|
35
|
+
return !1;
|
|
36
|
+
}
|
|
37
|
+
}, "Source link must be HTTP(S) or app-relative").optional().describe("Destination opened in a new tab when the source is selected")
|
|
38
|
+
}), b = e.object({
|
|
39
|
+
label: e.string().optional(),
|
|
40
|
+
text: e.string().min(1),
|
|
41
|
+
tone: x.optional()
|
|
32
42
|
}), f = {
|
|
33
|
-
eyebrow:
|
|
34
|
-
headline:
|
|
35
|
-
summary:
|
|
36
|
-
followUps:
|
|
37
|
-
sources:
|
|
38
|
-
}, A =
|
|
39
|
-
value:
|
|
40
|
-
detail:
|
|
41
|
-
tone:
|
|
42
|
-
}),
|
|
43
|
+
eyebrow: e.string().optional(),
|
|
44
|
+
headline: e.string().min(1),
|
|
45
|
+
summary: e.string().optional(),
|
|
46
|
+
followUps: e.array(F).max(3).optional(),
|
|
47
|
+
sources: e.array(q).max(8).optional()
|
|
48
|
+
}, A = e.object({
|
|
49
|
+
value: e.string().min(1),
|
|
50
|
+
detail: e.string().optional(),
|
|
51
|
+
tone: x.optional()
|
|
52
|
+
}), G = e.object({
|
|
43
53
|
...f,
|
|
44
|
-
kind:
|
|
45
|
-
subjects:
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
kind: e.literal("comparison"),
|
|
55
|
+
subjects: e.tuple([
|
|
56
|
+
e.object({ label: e.string().min(1), description: e.string().optional() }),
|
|
57
|
+
e.object({ label: e.string().min(1), description: e.string().optional() })
|
|
48
58
|
]),
|
|
49
|
-
rows:
|
|
50
|
-
|
|
51
|
-
label:
|
|
52
|
-
description:
|
|
53
|
-
values:
|
|
54
|
-
delta:
|
|
55
|
-
value:
|
|
56
|
-
tone:
|
|
59
|
+
rows: e.array(
|
|
60
|
+
e.object({
|
|
61
|
+
label: e.string().min(1),
|
|
62
|
+
description: e.string().min(1).optional().describe("Methodology, grain, or scope shown beneath the measure"),
|
|
63
|
+
values: e.tuple([A, A]),
|
|
64
|
+
delta: e.object({
|
|
65
|
+
value: e.string().min(1),
|
|
66
|
+
tone: x.optional()
|
|
57
67
|
}).optional()
|
|
58
68
|
})
|
|
59
69
|
).min(1).max(8),
|
|
60
|
-
takeaway:
|
|
61
|
-
}), k =
|
|
70
|
+
takeaway: b.optional()
|
|
71
|
+
}), k = e.enum([
|
|
62
72
|
"primary",
|
|
63
73
|
"success",
|
|
64
74
|
"warning",
|
|
65
75
|
"danger",
|
|
66
76
|
"info"
|
|
67
|
-
]),
|
|
68
|
-
|
|
69
|
-
kind:
|
|
70
|
-
value:
|
|
71
|
-
axis:
|
|
72
|
-
label:
|
|
77
|
+
]), J = e.discriminatedUnion("kind", [
|
|
78
|
+
e.object({
|
|
79
|
+
kind: e.literal("line"),
|
|
80
|
+
value: e.union([e.number(), e.string()]),
|
|
81
|
+
axis: e.enum(["x", "y"]).optional(),
|
|
82
|
+
label: e.string().optional(),
|
|
73
83
|
color: k.optional()
|
|
74
84
|
}),
|
|
75
|
-
|
|
76
|
-
kind:
|
|
77
|
-
from:
|
|
78
|
-
to:
|
|
79
|
-
axis:
|
|
80
|
-
label:
|
|
85
|
+
e.object({
|
|
86
|
+
kind: e.literal("band"),
|
|
87
|
+
from: e.union([e.number(), e.string()]),
|
|
88
|
+
to: e.union([e.number(), e.string()]),
|
|
89
|
+
axis: e.enum(["x", "y"]).optional(),
|
|
90
|
+
label: e.string().optional(),
|
|
81
91
|
color: k.optional()
|
|
82
92
|
}),
|
|
83
|
-
|
|
84
|
-
kind:
|
|
85
|
-
x:
|
|
86
|
-
y:
|
|
87
|
-
label:
|
|
88
|
-
description:
|
|
93
|
+
e.object({
|
|
94
|
+
kind: e.literal("point"),
|
|
95
|
+
x: e.union([e.number(), e.string()]),
|
|
96
|
+
y: e.number(),
|
|
97
|
+
label: e.string().min(1),
|
|
98
|
+
description: e.string().optional(),
|
|
89
99
|
color: k.optional()
|
|
90
100
|
})
|
|
91
|
-
]),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
),
|
|
101
|
+
]), Q = e.record(
|
|
102
|
+
e.string(),
|
|
103
|
+
e.union([e.string(), e.number(), e.null()])
|
|
104
|
+
), U = e.object({
|
|
95
105
|
...f,
|
|
96
|
-
kind:
|
|
97
|
-
metric:
|
|
98
|
-
label:
|
|
99
|
-
value:
|
|
100
|
-
change:
|
|
101
|
-
tone:
|
|
106
|
+
kind: e.literal("trend"),
|
|
107
|
+
metric: e.object({
|
|
108
|
+
label: e.string().min(1),
|
|
109
|
+
value: e.string().min(1),
|
|
110
|
+
change: e.string().optional(),
|
|
111
|
+
tone: x.optional()
|
|
102
112
|
}).optional(),
|
|
103
|
-
chart:
|
|
104
|
-
type:
|
|
105
|
-
data:
|
|
106
|
-
categoryKey:
|
|
107
|
-
series:
|
|
108
|
-
seriesLabels:
|
|
109
|
-
highlight:
|
|
110
|
-
unit:
|
|
111
|
-
annotations:
|
|
113
|
+
chart: e.object({
|
|
114
|
+
type: e.enum(["line", "area", "bar"]),
|
|
115
|
+
data: e.array(Q).min(1).max(100),
|
|
116
|
+
categoryKey: e.string().min(1),
|
|
117
|
+
series: e.array(e.string().min(1)).min(1).max(4),
|
|
118
|
+
seriesLabels: e.record(e.string(), e.string()).optional(),
|
|
119
|
+
highlight: e.string().optional(),
|
|
120
|
+
unit: e.string().optional(),
|
|
121
|
+
annotations: e.array(J).max(8).optional()
|
|
112
122
|
}),
|
|
113
|
-
insight:
|
|
114
|
-
}),
|
|
123
|
+
insight: b.optional()
|
|
124
|
+
}), X = e.object({
|
|
115
125
|
...f,
|
|
116
|
-
kind:
|
|
117
|
-
overall:
|
|
118
|
-
label:
|
|
119
|
-
value:
|
|
120
|
-
tone:
|
|
126
|
+
kind: e.literal("status"),
|
|
127
|
+
overall: e.object({
|
|
128
|
+
label: e.string().min(1),
|
|
129
|
+
value: e.string().min(1),
|
|
130
|
+
tone: x.optional()
|
|
121
131
|
}).optional(),
|
|
122
|
-
items:
|
|
123
|
-
|
|
124
|
-
label:
|
|
125
|
-
status:
|
|
126
|
-
detail:
|
|
127
|
-
meta:
|
|
128
|
-
tone:
|
|
132
|
+
items: e.array(
|
|
133
|
+
e.object({
|
|
134
|
+
label: e.string().min(1),
|
|
135
|
+
status: e.string().min(1),
|
|
136
|
+
detail: e.string().optional(),
|
|
137
|
+
meta: e.string().optional(),
|
|
138
|
+
tone: x.optional()
|
|
129
139
|
})
|
|
130
140
|
).min(1).max(12),
|
|
131
|
-
recommendation:
|
|
132
|
-
}),
|
|
141
|
+
recommendation: b.optional()
|
|
142
|
+
}), Y = e.object({
|
|
133
143
|
...f,
|
|
134
|
-
kind:
|
|
135
|
-
total:
|
|
136
|
-
items:
|
|
137
|
-
|
|
138
|
-
label:
|
|
139
|
-
value:
|
|
140
|
-
share:
|
|
141
|
-
detail:
|
|
142
|
-
tone:
|
|
144
|
+
kind: e.literal("breakdown"),
|
|
145
|
+
total: e.object({ label: e.string().min(1), value: e.string().min(1) }).optional(),
|
|
146
|
+
items: e.array(
|
|
147
|
+
e.object({
|
|
148
|
+
label: e.string().min(1),
|
|
149
|
+
value: e.string().min(1),
|
|
150
|
+
share: e.number().min(0).max(100),
|
|
151
|
+
detail: e.string().optional(),
|
|
152
|
+
tone: x.optional()
|
|
143
153
|
})
|
|
144
154
|
).min(1).max(12),
|
|
145
|
-
insight:
|
|
146
|
-
}),
|
|
155
|
+
insight: b.optional()
|
|
156
|
+
}), Z = e.object({
|
|
147
157
|
...f,
|
|
148
|
-
kind:
|
|
149
|
-
sections:
|
|
150
|
-
|
|
151
|
-
title:
|
|
152
|
-
body:
|
|
153
|
-
bullets:
|
|
158
|
+
kind: e.literal("explanation"),
|
|
159
|
+
sections: e.array(
|
|
160
|
+
e.object({
|
|
161
|
+
title: e.string().min(1),
|
|
162
|
+
body: e.string().optional(),
|
|
163
|
+
bullets: e.array(e.string().min(1)).max(5).optional()
|
|
154
164
|
})
|
|
155
165
|
).min(1).max(6),
|
|
156
|
-
takeaway:
|
|
157
|
-
}),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
Q,
|
|
166
|
+
takeaway: b.optional()
|
|
167
|
+
}), ee = e.discriminatedUnion("kind", [
|
|
168
|
+
G,
|
|
169
|
+
U,
|
|
161
170
|
X,
|
|
162
|
-
Y
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
171
|
+
Y,
|
|
172
|
+
Z
|
|
173
|
+
]), pe = {
|
|
174
|
+
name: K,
|
|
175
|
+
description: H,
|
|
176
|
+
inputSchema: ee
|
|
177
|
+
}, v = L("font-semibold tabular-nums text-foreground", {
|
|
168
178
|
variants: {
|
|
169
179
|
tone: {
|
|
170
180
|
default: "text-foreground",
|
|
@@ -176,45 +186,49 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
|
|
|
176
186
|
}
|
|
177
187
|
},
|
|
178
188
|
defaultVariants: { tone: "default" }
|
|
179
|
-
}),
|
|
189
|
+
}), te = new Intl.NumberFormat("en-US", {
|
|
180
190
|
notation: "compact",
|
|
181
191
|
maximumFractionDigits: 1
|
|
182
|
-
}),
|
|
183
|
-
function y({ spec:
|
|
192
|
+
}), ae = (t) => t === "success" || t === "warning" || t === "danger" || t === "info" ? t : "default", ne = (t) => t === "success" || t === "warning" || t === "danger" || t === "info" ? t : "primary";
|
|
193
|
+
function y({ spec: t }) {
|
|
184
194
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
185
|
-
|
|
186
|
-
/* @__PURE__ */ a("h2", { className: "max-w-2xl text-xl font-bold leading-tight tracking-tight text-foreground", children:
|
|
187
|
-
|
|
195
|
+
t.eyebrow && /* @__PURE__ */ a("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: t.eyebrow }),
|
|
196
|
+
/* @__PURE__ */ a("h2", { className: "max-w-2xl text-xl font-bold leading-tight tracking-tight text-foreground", children: t.headline }),
|
|
197
|
+
t.summary && /* @__PURE__ */ a("p", { className: "max-w-2xl text-sm leading-6 text-secondary", children: t.summary })
|
|
188
198
|
] });
|
|
189
199
|
}
|
|
190
|
-
function w({ signal:
|
|
191
|
-
return /* @__PURE__ */ i(
|
|
192
|
-
/* @__PURE__ */ a(B, { children:
|
|
193
|
-
/* @__PURE__ */ a($, { children:
|
|
200
|
+
function w({ signal: t }) {
|
|
201
|
+
return /* @__PURE__ */ i(E, { variant: ae(t.tone), children: [
|
|
202
|
+
/* @__PURE__ */ a(B, { children: t.label ?? "Takeaway" }),
|
|
203
|
+
/* @__PURE__ */ a($, { children: t.text })
|
|
194
204
|
] });
|
|
195
205
|
}
|
|
196
206
|
function N({
|
|
197
|
-
followUps:
|
|
207
|
+
followUps: t,
|
|
198
208
|
sources: r,
|
|
199
209
|
onFollowUp: s,
|
|
200
210
|
onSourceSelect: o
|
|
201
211
|
}) {
|
|
202
|
-
return !(
|
|
203
|
-
!!(e != null && e.length) && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: e.map((l) => /* @__PURE__ */ a(
|
|
204
|
-
V,
|
|
205
|
-
{
|
|
206
|
-
type: "button",
|
|
207
|
-
disabled: !s,
|
|
208
|
-
onClick: () => s == null ? void 0 : s(l),
|
|
209
|
-
children: l.label
|
|
210
|
-
},
|
|
211
|
-
l.id
|
|
212
|
-
)) }),
|
|
212
|
+
return !(t != null && t.length) && !(r != null && r.length) ? null : /* @__PURE__ */ i("div", { className: "space-y-3 pt-1", children: [
|
|
213
213
|
!!(r != null && r.length) && /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
214
214
|
/* @__PURE__ */ a("span", { className: "mr-1 text-xs font-medium text-tertiary", children: "Sources" }),
|
|
215
215
|
r.map(
|
|
216
|
-
(l) =>
|
|
217
|
-
|
|
216
|
+
(l) => l.href ? /* @__PURE__ */ i(
|
|
217
|
+
P,
|
|
218
|
+
{
|
|
219
|
+
href: l.href,
|
|
220
|
+
variant: "muted",
|
|
221
|
+
size: "sm",
|
|
222
|
+
title: l.description,
|
|
223
|
+
className: "h-6 rounded-full px-2",
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ a(V, { children: l.label }),
|
|
226
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: " (opens in a new tab)" })
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
l.id
|
|
230
|
+
) : o ? /* @__PURE__ */ a(
|
|
231
|
+
z,
|
|
218
232
|
{
|
|
219
233
|
type: "button",
|
|
220
234
|
size: "xs",
|
|
@@ -225,22 +239,32 @@ function N({
|
|
|
225
239
|
children: l.label
|
|
226
240
|
},
|
|
227
241
|
l.id
|
|
228
|
-
) : /* @__PURE__ */ a(
|
|
242
|
+
) : /* @__PURE__ */ a(p, { variant: "soft", title: l.description, children: l.label }, l.id)
|
|
229
243
|
)
|
|
230
|
-
] })
|
|
244
|
+
] }),
|
|
245
|
+
!!(t != null && t.length) && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: t.map((l) => /* @__PURE__ */ a(
|
|
246
|
+
O,
|
|
247
|
+
{
|
|
248
|
+
type: "button",
|
|
249
|
+
disabled: !s,
|
|
250
|
+
onClick: () => s == null ? void 0 : s(l),
|
|
251
|
+
children: l.label
|
|
252
|
+
},
|
|
253
|
+
l.id
|
|
254
|
+
)) })
|
|
231
255
|
] });
|
|
232
256
|
}
|
|
233
|
-
const j =
|
|
257
|
+
const j = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
|
|
234
258
|
"div",
|
|
235
259
|
{
|
|
236
260
|
ref: m,
|
|
237
|
-
"data-answer-kind":
|
|
261
|
+
"data-answer-kind": t.kind,
|
|
238
262
|
className: c("w-full max-w-2xl space-y-5", o),
|
|
239
263
|
...l,
|
|
240
264
|
children: [
|
|
241
|
-
/* @__PURE__ */ a(y, { spec:
|
|
265
|
+
/* @__PURE__ */ a(y, { spec: t }),
|
|
242
266
|
/* @__PURE__ */ a("div", { className: "overflow-x-auto rounded-2xl bg-surface p-2", children: /* @__PURE__ */ i("table", { className: "w-full min-w-[32rem] border-separate border-spacing-y-1 text-left", children: [
|
|
243
|
-
/* @__PURE__ */ a("caption", { className: "sr-only", children:
|
|
267
|
+
/* @__PURE__ */ a("caption", { className: "sr-only", children: t.headline }),
|
|
244
268
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ i("tr", { children: [
|
|
245
269
|
/* @__PURE__ */ a(
|
|
246
270
|
"th",
|
|
@@ -250,7 +274,7 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
|
|
|
250
274
|
children: "Measure"
|
|
251
275
|
}
|
|
252
276
|
),
|
|
253
|
-
|
|
277
|
+
t.subjects.map((n) => /* @__PURE__ */ i(
|
|
254
278
|
"th",
|
|
255
279
|
{
|
|
256
280
|
scope: "col",
|
|
@@ -265,13 +289,13 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
|
|
|
265
289
|
/* @__PURE__ */ i("th", { scope: "col", className: "px-3 py-2 align-bottom", children: [
|
|
266
290
|
/* @__PURE__ */ a("span", { className: "block text-sm font-semibold text-foreground", children: "Difference" }),
|
|
267
291
|
/* @__PURE__ */ i("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: [
|
|
268
|
-
|
|
292
|
+
t.subjects[1].label,
|
|
269
293
|
" − ",
|
|
270
|
-
|
|
294
|
+
t.subjects[0].label
|
|
271
295
|
] })
|
|
272
296
|
] })
|
|
273
297
|
] }) }),
|
|
274
|
-
/* @__PURE__ */ a("tbody", { children:
|
|
298
|
+
/* @__PURE__ */ a("tbody", { children: t.rows.map((n) => {
|
|
275
299
|
const d = n.values[0].detail === n.values[1].detail ? n.values[0].detail : void 0, h = n.description ?? d;
|
|
276
300
|
return /* @__PURE__ */ i("tr", { className: "[&>*]:bg-muted/60", children: [
|
|
277
301
|
/* @__PURE__ */ i(
|
|
@@ -300,7 +324,7 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
|
|
|
300
324
|
}
|
|
301
325
|
)
|
|
302
326
|
},
|
|
303
|
-
`${n.label}-${
|
|
327
|
+
`${n.label}-${t.subjects[D].label}`
|
|
304
328
|
)),
|
|
305
329
|
/* @__PURE__ */ a("td", { className: "rounded-r-xl px-3 py-3 align-top", children: n.delta ? /* @__PURE__ */ a(
|
|
306
330
|
"span",
|
|
@@ -315,12 +339,12 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
|
|
|
315
339
|
] }, n.label);
|
|
316
340
|
}) })
|
|
317
341
|
] }) }),
|
|
318
|
-
|
|
342
|
+
t.takeaway && /* @__PURE__ */ a(w, { signal: t.takeaway }),
|
|
319
343
|
/* @__PURE__ */ a(
|
|
320
344
|
N,
|
|
321
345
|
{
|
|
322
|
-
followUps:
|
|
323
|
-
sources:
|
|
346
|
+
followUps: t.followUps,
|
|
347
|
+
sources: t.sources,
|
|
324
348
|
onFollowUp: r,
|
|
325
349
|
onSourceSelect: s
|
|
326
350
|
}
|
|
@@ -329,18 +353,18 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
|
|
|
329
353
|
}
|
|
330
354
|
));
|
|
331
355
|
j.displayName = "ComparisonAnswer";
|
|
332
|
-
const S =
|
|
333
|
-
({ spec:
|
|
334
|
-
const n =
|
|
335
|
-
() =>
|
|
336
|
-
[
|
|
356
|
+
const S = u.forwardRef(
|
|
357
|
+
({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => {
|
|
358
|
+
const n = u.useMemo(
|
|
359
|
+
() => t.chart.unit ? (h) => `${te.format(h)}${t.chart.unit}` : void 0,
|
|
360
|
+
[t.chart.unit]
|
|
337
361
|
), d = {
|
|
338
|
-
data:
|
|
339
|
-
categoryKey:
|
|
340
|
-
series:
|
|
341
|
-
seriesLabels:
|
|
342
|
-
highlight:
|
|
343
|
-
annotations:
|
|
362
|
+
data: t.chart.data,
|
|
363
|
+
categoryKey: t.chart.categoryKey,
|
|
364
|
+
series: t.chart.series,
|
|
365
|
+
seriesLabels: t.chart.seriesLabels,
|
|
366
|
+
highlight: t.chart.highlight,
|
|
367
|
+
annotations: t.chart.annotations,
|
|
344
368
|
formatValue: n,
|
|
345
369
|
height: 224
|
|
346
370
|
};
|
|
@@ -348,34 +372,34 @@ const S = x.forwardRef(
|
|
|
348
372
|
"div",
|
|
349
373
|
{
|
|
350
374
|
ref: m,
|
|
351
|
-
"data-answer-kind":
|
|
375
|
+
"data-answer-kind": t.kind,
|
|
352
376
|
className: c("w-full max-w-2xl space-y-5", o),
|
|
353
377
|
...l,
|
|
354
378
|
children: [
|
|
355
379
|
/* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-4 sm:flex-row sm:items-end", children: [
|
|
356
|
-
/* @__PURE__ */ a(y, { spec:
|
|
357
|
-
|
|
358
|
-
/* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children:
|
|
380
|
+
/* @__PURE__ */ a(y, { spec: t }),
|
|
381
|
+
t.metric && /* @__PURE__ */ i("div", { className: "shrink-0 rounded-xl bg-muted px-4 py-3 text-left", children: [
|
|
382
|
+
/* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: t.metric.label }),
|
|
359
383
|
/* @__PURE__ */ a(
|
|
360
384
|
"p",
|
|
361
385
|
{
|
|
362
386
|
className: c(
|
|
363
|
-
v({ tone:
|
|
387
|
+
v({ tone: t.metric.tone }),
|
|
364
388
|
"mt-1 text-2xl tracking-tight"
|
|
365
389
|
),
|
|
366
|
-
children:
|
|
390
|
+
children: t.metric.value
|
|
367
391
|
}
|
|
368
392
|
),
|
|
369
|
-
|
|
393
|
+
t.metric.change && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-secondary", children: t.metric.change })
|
|
370
394
|
] })
|
|
371
395
|
] }),
|
|
372
|
-
/* @__PURE__ */ a("div", { className: "rounded-2xl bg-surface px-3 pb-2 pt-4 sm:px-4", children:
|
|
373
|
-
|
|
396
|
+
/* @__PURE__ */ a("div", { className: "rounded-2xl bg-surface px-3 pb-2 pt-4 sm:px-4", children: t.chart.type === "area" ? /* @__PURE__ */ a(_, { ...d }) : t.chart.type === "bar" ? /* @__PURE__ */ a(M, { ...d }) : /* @__PURE__ */ a(W, { ...d }) }),
|
|
397
|
+
t.insight && /* @__PURE__ */ a(w, { signal: t.insight }),
|
|
374
398
|
/* @__PURE__ */ a(
|
|
375
399
|
N,
|
|
376
400
|
{
|
|
377
|
-
followUps:
|
|
378
|
-
sources:
|
|
401
|
+
followUps: t.followUps,
|
|
402
|
+
sources: t.sources,
|
|
379
403
|
onFollowUp: r,
|
|
380
404
|
onSourceSelect: s
|
|
381
405
|
}
|
|
@@ -386,32 +410,32 @@ const S = x.forwardRef(
|
|
|
386
410
|
}
|
|
387
411
|
);
|
|
388
412
|
S.displayName = "TrendAnswer";
|
|
389
|
-
const C =
|
|
390
|
-
({ spec:
|
|
413
|
+
const C = u.forwardRef(
|
|
414
|
+
({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
|
|
391
415
|
"div",
|
|
392
416
|
{
|
|
393
417
|
ref: m,
|
|
394
|
-
"data-answer-kind":
|
|
418
|
+
"data-answer-kind": t.kind,
|
|
395
419
|
className: c("w-full max-w-2xl space-y-5", o),
|
|
396
420
|
...l,
|
|
397
421
|
children: [
|
|
398
422
|
/* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-start", children: [
|
|
399
|
-
/* @__PURE__ */ a(y, { spec:
|
|
400
|
-
|
|
401
|
-
|
|
423
|
+
/* @__PURE__ */ a(y, { spec: t }),
|
|
424
|
+
t.overall && /* @__PURE__ */ i(
|
|
425
|
+
p,
|
|
402
426
|
{
|
|
403
427
|
variant: "soft",
|
|
404
|
-
color:
|
|
428
|
+
color: t.overall.tone ?? "default",
|
|
405
429
|
className: "self-start",
|
|
406
430
|
children: [
|
|
407
|
-
|
|
431
|
+
t.overall.label,
|
|
408
432
|
" · ",
|
|
409
|
-
|
|
433
|
+
t.overall.value
|
|
410
434
|
]
|
|
411
435
|
}
|
|
412
436
|
)
|
|
413
437
|
] }),
|
|
414
|
-
/* @__PURE__ */ a("ul", { className: "space-y-2", children:
|
|
438
|
+
/* @__PURE__ */ a("ul", { className: "space-y-2", children: t.items.map((n) => /* @__PURE__ */ i(
|
|
415
439
|
"li",
|
|
416
440
|
{
|
|
417
441
|
className: "flex items-start justify-between gap-4 rounded-xl bg-surface px-4 py-3",
|
|
@@ -421,19 +445,19 @@ const C = x.forwardRef(
|
|
|
421
445
|
n.detail && /* @__PURE__ */ a("p", { className: "mt-1 text-xs leading-5 text-secondary", children: n.detail })
|
|
422
446
|
] }),
|
|
423
447
|
/* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
|
|
424
|
-
/* @__PURE__ */ a(
|
|
448
|
+
/* @__PURE__ */ a(p, { variant: "dot", color: n.tone ?? "default", children: n.status }),
|
|
425
449
|
n.meta && /* @__PURE__ */ a("p", { className: "mt-1 text-xs tabular-nums text-tertiary", children: n.meta })
|
|
426
450
|
] })
|
|
427
451
|
]
|
|
428
452
|
},
|
|
429
453
|
n.label
|
|
430
454
|
)) }),
|
|
431
|
-
|
|
455
|
+
t.recommendation && /* @__PURE__ */ a(w, { signal: t.recommendation }),
|
|
432
456
|
/* @__PURE__ */ a(
|
|
433
457
|
N,
|
|
434
458
|
{
|
|
435
|
-
followUps:
|
|
436
|
-
sources:
|
|
459
|
+
followUps: t.followUps,
|
|
460
|
+
sources: t.sources,
|
|
437
461
|
onFollowUp: r,
|
|
438
462
|
onSourceSelect: s
|
|
439
463
|
}
|
|
@@ -443,25 +467,25 @@ const C = x.forwardRef(
|
|
|
443
467
|
)
|
|
444
468
|
);
|
|
445
469
|
C.displayName = "StatusAnswer";
|
|
446
|
-
const
|
|
470
|
+
const T = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
|
|
447
471
|
"div",
|
|
448
472
|
{
|
|
449
473
|
ref: m,
|
|
450
|
-
"data-answer-kind":
|
|
474
|
+
"data-answer-kind": t.kind,
|
|
451
475
|
className: c("w-full max-w-2xl space-y-5", o),
|
|
452
476
|
...l,
|
|
453
477
|
children: [
|
|
454
478
|
/* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-end", children: [
|
|
455
|
-
/* @__PURE__ */ a(y, { spec:
|
|
456
|
-
|
|
457
|
-
/* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children:
|
|
458
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children:
|
|
479
|
+
/* @__PURE__ */ a(y, { spec: t }),
|
|
480
|
+
t.total && /* @__PURE__ */ i("div", { className: "shrink-0 sm:text-right", children: [
|
|
481
|
+
/* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: t.total.label }),
|
|
482
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children: t.total.value })
|
|
459
483
|
] })
|
|
460
484
|
] }),
|
|
461
|
-
/* @__PURE__ */ a("ol", { className: "space-y-2", children:
|
|
485
|
+
/* @__PURE__ */ a("ol", { className: "space-y-2", children: t.items.map((n, d) => /* @__PURE__ */ i("li", { className: "rounded-xl bg-surface px-4 py-3", children: [
|
|
462
486
|
/* @__PURE__ */ i("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
|
|
463
487
|
/* @__PURE__ */ i("div", { className: "flex min-w-0 items-start gap-2.5", children: [
|
|
464
|
-
/* @__PURE__ */ a(
|
|
488
|
+
/* @__PURE__ */ a(p, { variant: "soft", className: "mt-0.5 tabular-nums", children: d + 1 }),
|
|
465
489
|
/* @__PURE__ */ i("div", { className: "min-w-0", children: [
|
|
466
490
|
/* @__PURE__ */ a("p", { className: "text-sm font-medium text-foreground", children: n.label }),
|
|
467
491
|
n.detail && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-tertiary", children: n.detail })
|
|
@@ -476,21 +500,21 @@ const R = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
|
|
|
476
500
|
] })
|
|
477
501
|
] }),
|
|
478
502
|
/* @__PURE__ */ a(
|
|
479
|
-
|
|
503
|
+
I,
|
|
480
504
|
{
|
|
481
505
|
value: n.share,
|
|
482
506
|
size: "sm",
|
|
483
|
-
color:
|
|
507
|
+
color: ne(n.tone),
|
|
484
508
|
label: `${n.label}: ${n.share}%`
|
|
485
509
|
}
|
|
486
510
|
)
|
|
487
511
|
] }, n.label)) }),
|
|
488
|
-
|
|
512
|
+
t.insight && /* @__PURE__ */ a(w, { signal: t.insight }),
|
|
489
513
|
/* @__PURE__ */ a(
|
|
490
514
|
N,
|
|
491
515
|
{
|
|
492
|
-
followUps:
|
|
493
|
-
sources:
|
|
516
|
+
followUps: t.followUps,
|
|
517
|
+
sources: t.sources,
|
|
494
518
|
onFollowUp: r,
|
|
495
519
|
onSourceSelect: s
|
|
496
520
|
}
|
|
@@ -498,20 +522,20 @@ const R = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
|
|
|
498
522
|
]
|
|
499
523
|
}
|
|
500
524
|
));
|
|
501
|
-
|
|
502
|
-
const
|
|
525
|
+
T.displayName = "BreakdownAnswer";
|
|
526
|
+
const R = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
|
|
503
527
|
"div",
|
|
504
528
|
{
|
|
505
529
|
ref: m,
|
|
506
|
-
"data-answer-kind":
|
|
530
|
+
"data-answer-kind": t.kind,
|
|
507
531
|
className: c("w-full max-w-2xl space-y-5", o),
|
|
508
532
|
...l,
|
|
509
533
|
children: [
|
|
510
|
-
/* @__PURE__ */ a(y, { spec:
|
|
511
|
-
/* @__PURE__ */ a("ol", { className: "space-y-2", children:
|
|
534
|
+
/* @__PURE__ */ a(y, { spec: t }),
|
|
535
|
+
/* @__PURE__ */ a("ol", { className: "space-y-2", children: t.sections.map((n, d) => {
|
|
512
536
|
var h;
|
|
513
537
|
return /* @__PURE__ */ i("li", { className: "flex gap-3 rounded-xl bg-surface px-4 py-3.5", children: [
|
|
514
|
-
/* @__PURE__ */ a(
|
|
538
|
+
/* @__PURE__ */ a(p, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: d + 1 }),
|
|
515
539
|
/* @__PURE__ */ i("div", { className: "min-w-0", children: [
|
|
516
540
|
/* @__PURE__ */ a("h3", { className: "text-sm font-semibold text-foreground", children: n.title }),
|
|
517
541
|
n.body && /* @__PURE__ */ a("p", { className: "mt-1 text-sm leading-6 text-secondary", children: n.body }),
|
|
@@ -528,12 +552,12 @@ const T = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
|
|
|
528
552
|
] })
|
|
529
553
|
] }, n.title);
|
|
530
554
|
}) }),
|
|
531
|
-
|
|
555
|
+
t.takeaway && /* @__PURE__ */ a(w, { signal: t.takeaway }),
|
|
532
556
|
/* @__PURE__ */ a(
|
|
533
557
|
N,
|
|
534
558
|
{
|
|
535
|
-
followUps:
|
|
536
|
-
sources:
|
|
559
|
+
followUps: t.followUps,
|
|
560
|
+
sources: t.sources,
|
|
537
561
|
onFollowUp: r,
|
|
538
562
|
onSourceSelect: s
|
|
539
563
|
}
|
|
@@ -541,42 +565,42 @@ const T = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
|
|
|
541
565
|
]
|
|
542
566
|
}
|
|
543
567
|
));
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
({ spec:
|
|
547
|
-
switch (
|
|
568
|
+
R.displayName = "ExplanationAnswer";
|
|
569
|
+
const ie = u.forwardRef(
|
|
570
|
+
({ spec: t, ...r }, s) => {
|
|
571
|
+
switch (t.kind) {
|
|
548
572
|
case "comparison":
|
|
549
|
-
return /* @__PURE__ */ a(j, { ref: s, spec:
|
|
573
|
+
return /* @__PURE__ */ a(j, { ref: s, spec: t, ...r });
|
|
550
574
|
case "trend":
|
|
551
|
-
return /* @__PURE__ */ a(S, { ref: s, spec:
|
|
575
|
+
return /* @__PURE__ */ a(S, { ref: s, spec: t, ...r });
|
|
552
576
|
case "status":
|
|
553
|
-
return /* @__PURE__ */ a(C, { ref: s, spec:
|
|
577
|
+
return /* @__PURE__ */ a(C, { ref: s, spec: t, ...r });
|
|
554
578
|
case "breakdown":
|
|
555
|
-
return /* @__PURE__ */ a(
|
|
579
|
+
return /* @__PURE__ */ a(T, { ref: s, spec: t, ...r });
|
|
556
580
|
case "explanation":
|
|
557
|
-
return /* @__PURE__ */ a(
|
|
581
|
+
return /* @__PURE__ */ a(R, { ref: s, spec: t, ...r });
|
|
558
582
|
}
|
|
559
583
|
}
|
|
560
584
|
);
|
|
561
|
-
|
|
585
|
+
ie.displayName = "AnswerRenderer";
|
|
562
586
|
export {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
587
|
+
H as ANSWER_TOOL_DESCRIPTION,
|
|
588
|
+
K as ANSWER_TOOL_NAME,
|
|
589
|
+
F as AnswerFollowUpSchema,
|
|
590
|
+
ie as AnswerRenderer,
|
|
591
|
+
b as AnswerSignalSchema,
|
|
592
|
+
q as AnswerSourceSchema,
|
|
593
|
+
ee as AnswerSpecSchema,
|
|
594
|
+
x as AnswerToneSchema,
|
|
595
|
+
T as BreakdownAnswer,
|
|
596
|
+
Y as BreakdownAnswerSchema,
|
|
573
597
|
j as ComparisonAnswer,
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
598
|
+
G as ComparisonAnswerSchema,
|
|
599
|
+
R as ExplanationAnswer,
|
|
600
|
+
Z as ExplanationAnswerSchema,
|
|
577
601
|
C as StatusAnswer,
|
|
578
|
-
|
|
602
|
+
X as StatusAnswerSchema,
|
|
579
603
|
S as TrendAnswer,
|
|
580
|
-
|
|
581
|
-
|
|
604
|
+
U as TrendAnswerSchema,
|
|
605
|
+
pe as answerTool
|
|
582
606
|
};
|