@actioneer/ads 0.5.6 → 0.5.8
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/bin/ads-init.mjs +6 -0
- package/components/accordion.js +50 -48
- package/components/agent-icon.d.ts +12 -0
- package/components/agent-icon.js +135 -121
- package/components/ai-elements/chain-of-thought-icon.d.ts +10 -12
- package/components/ai-elements/chain-of-thought-icon.js +341 -201
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +108 -108
- package/components/ai-elements/chart.js +16 -14
- package/components/ai-elements/inline-citation.js +41 -41
- package/components/ai-elements/message.js +4 -4
- package/components/ai-elements/queue.js +7 -7
- package/components/ai-elements/research-activity.js +114 -114
- package/components/ai-elements/shimmer.d.ts +2 -2
- package/components/ai-elements/speech-input.js +28 -28
- package/components/ai-elements/task-progress.js +26 -16
- package/components/ai-elements/task.js +17 -17
- package/components/ai-elements/tool.js +6 -6
- package/components/ai-elements/transcript.js +6 -5
- package/components/ai-elements/voice.js +1 -1
- package/components/alert.js +10 -10
- package/components/answer-sources.d.ts +42 -0
- package/components/answer-sources.js +111 -0
- package/components/answer.js +115 -114
- package/components/assistant-ui/action-bar.js +94 -48
- package/components/assistant-ui/attachment.js +131 -103
- package/components/assistant-ui/badge.d.ts +1 -1
- package/components/assistant-ui/badge.js +17 -17
- package/components/assistant-ui/chain-of-thought.d.ts +1 -1
- package/components/assistant-ui/composer-add-context.js +9 -9
- package/components/assistant-ui/composer-deep-research.js +5 -5
- package/components/assistant-ui/composer-harness.js +12 -9
- package/components/assistant-ui/composer-trigger-popover.js +45 -34
- package/components/assistant-ui/composer.js +59 -59
- package/components/assistant-ui/error.js +14 -14
- package/components/assistant-ui/file.d.ts +1 -1
- package/components/assistant-ui/image.d.ts +1 -1
- package/components/assistant-ui/image.js +113 -103
- package/components/assistant-ui/markdown-text.js +18 -18
- package/components/assistant-ui/message.js +46 -45
- package/components/assistant-ui/quote.js +1 -1
- package/components/assistant-ui/reasoning.d.ts +1 -1
- package/components/assistant-ui/reasoning.js +66 -77
- package/components/assistant-ui/suggestions.js +4 -4
- package/components/assistant-ui/thread-context.d.ts +2 -0
- package/components/assistant-ui/thread.js +41 -40
- package/components/assistant-ui/tool-fallback.js +60 -63
- package/components/assistant-ui/tool-group.d.ts +1 -1
- package/components/assistant-ui/tool-group.js +36 -42
- package/components/audio-waveform.js +25 -24
- package/components/autocomplete.d.ts +1 -0
- package/components/autocomplete.js +45 -43
- package/components/avatar.js +30 -30
- package/components/badge.d.ts +1 -1
- package/components/breadcrumbs.js +2 -2
- package/components/button.d.ts +2 -2
- package/components/button.js +22 -20
- package/components/card.js +8 -8
- package/components/carousel.js +105 -104
- package/components/chart.js +9 -7
- package/components/checkbox.js +74 -38
- package/components/chip.d.ts +1 -1
- package/components/code-block.js +3 -3
- package/components/collapsible.js +67 -23
- package/components/connector-card.js +6 -6
- package/components/drawer.d.ts +15 -10
- package/components/drawer.js +78 -77
- package/components/dropdown.d.ts +3 -1
- package/components/dropdown.js +88 -79
- package/components/empty-state.d.ts +4 -4
- package/components/empty-state.js +7 -7
- package/components/field.d.ts +4 -0
- package/components/field.js +45 -34
- package/components/file-dropzone.js +12 -12
- package/components/index.d.ts +4 -0
- package/components/index.js +584 -553
- package/components/infinite-canvas.js +1 -1
- package/components/input-field.js +51 -46
- package/components/input.js +20 -20
- package/components/link.js +9 -9
- package/components/modal.js +105 -73
- package/components/navbar.d.ts +1 -1
- package/components/navbar.js +1 -1
- package/components/number-field.js +38 -29
- package/components/page-header.js +12 -12
- package/components/pagination.js +19 -19
- package/components/panel.js +2 -2
- package/components/pixel-blast-svg.js +3 -3
- package/components/pixel-icon.d.ts +3 -1
- package/components/pixel-icon.js +294 -215
- package/components/popover.d.ts +1 -1
- package/components/popover.js +66 -64
- package/components/progress-circle.js +36 -32
- package/components/progress.js +28 -24
- package/components/radio.js +59 -49
- package/components/resizable-panel.js +1 -1
- package/components/reveal.d.ts +2 -2
- package/components/ripple.d.ts +3 -3
- package/components/scroll-area.js +17 -16
- package/components/segmented.d.ts +4 -1
- package/components/segmented.js +26 -25
- package/components/select.d.ts +2 -0
- package/components/select.js +61 -57
- package/components/setting-row.js +45 -42
- package/components/sidebar.d.ts +2 -2
- package/components/sidebar.js +131 -127
- package/components/skeleton.js +5 -5
- package/components/spinner.d.ts +13 -4
- package/components/spinner.js +42 -42
- package/components/stepper.js +21 -21
- package/components/switch.js +52 -32
- package/components/table.d.ts +24 -7
- package/components/table.js +457 -220
- package/components/tabs.js +149 -137
- package/components/textarea.js +1 -2
- package/components/toast.js +66 -66
- package/components/tooltip.js +2 -2
- package/components/tree.js +62 -51
- package/components/typography.d.ts +2 -1
- package/components/typography.js +33 -32
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +19 -19
- package/components/ui/collapsible.d.ts +1 -5
- package/components/ui/dialog.d.ts +3 -3
- package/components/ui/dialog.js +95 -58
- package/components/ui/tooltip.d.ts +2 -2
- package/components/ui/tooltip.js +67 -33
- package/components/viz-charts.js +95 -95
- package/demo/components/add-to-artifact.js +341 -0
- package/demo/lib/artifact-library.js +134 -0
- package/fonts/aribau-grotesk-medium.woff2 +0 -0
- package/fonts/aribau-grotesk-regular.woff2 +0 -0
- package/fonts.css +11 -11
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
- package/lib/icons.d.ts +12 -0
- package/lib/icons.js +107 -104
- package/lib/motion.d.ts +42 -39
- package/lib/motion.js +112 -52
- package/lib/spinner-mark.d.ts +9 -0
- package/lib/spinner-mark.js +98 -0
- package/llms.txt +69 -26
- package/manifest.json +344 -42
- package/package.json +1 -1
- package/styles.css +175 -161
- package/theme.css +104 -128
- package/components/ui/collapsible.js +0 -35
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as r, jsx as e, Fragment as
|
|
3
|
-
import * as
|
|
4
|
-
import { MotionConfig as ee, AnimatePresence as te, motion as
|
|
2
|
+
import { jsxs as r, jsx as e, Fragment as q } from "react/jsx-runtime";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { MotionConfig as ee, AnimatePresence as te, motion as T } from "motion/react";
|
|
5
5
|
import { cva as re } from "class-variance-authority";
|
|
6
|
-
import { Collapsible as ae, CollapsibleTrigger as
|
|
7
|
-
import { ChevronDown as
|
|
8
|
-
import {
|
|
9
|
-
import { cn as
|
|
10
|
-
import { Shimmer as
|
|
11
|
-
import { TraceStateIcon as
|
|
12
|
-
const
|
|
6
|
+
import { Collapsible as ae, CollapsibleTrigger as V, CollapsibleContent as ie } from "../collapsible.js";
|
|
7
|
+
import { ChevronDown as B } from "../../lib/icons.js";
|
|
8
|
+
import { springEffect as F, springDisclosure as se } from "../../lib/motion.js";
|
|
9
|
+
import { cn as o } from "../../lib/cn.js";
|
|
10
|
+
import { Shimmer as K } from "./shimmer.js";
|
|
11
|
+
import { TraceStateIcon as P } from "./chain-of-thought-icon.js";
|
|
12
|
+
const ne = re(
|
|
13
13
|
// Contained card: a hairline border (no fill) so the whole trace reads as one
|
|
14
14
|
// distinct, trackable block within the chat without tinting the ground.
|
|
15
15
|
"w-full rounded-lg border border-border px-3 py-2",
|
|
@@ -21,7 +21,7 @@ const se = re(
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
),
|
|
24
|
+
), le = {
|
|
25
25
|
initial: {
|
|
26
26
|
opacity: 0,
|
|
27
27
|
transform: "translate3d(0, 7px, 0)",
|
|
@@ -31,224 +31,224 @@ const se = re(
|
|
|
31
31
|
opacity: 1,
|
|
32
32
|
transform: "translate3d(0, 0, 0)",
|
|
33
33
|
filter: "blur(0px)",
|
|
34
|
-
transition:
|
|
34
|
+
transition: F
|
|
35
35
|
},
|
|
36
36
|
exit: {
|
|
37
37
|
opacity: 0,
|
|
38
38
|
transform: "translate3d(0, -7px, 0)",
|
|
39
39
|
filter: "blur(2px)",
|
|
40
|
-
transition:
|
|
40
|
+
transition: F
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
function
|
|
43
|
+
function $({
|
|
44
44
|
elapsed: t,
|
|
45
|
-
firstInsight:
|
|
46
|
-
sourceCount:
|
|
45
|
+
firstInsight: n,
|
|
46
|
+
sourceCount: m
|
|
47
47
|
}) {
|
|
48
48
|
return /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1", children: [
|
|
49
49
|
/* @__PURE__ */ r("span", { children: [
|
|
50
50
|
"Researched ",
|
|
51
|
-
|
|
51
|
+
m,
|
|
52
52
|
" ",
|
|
53
|
-
|
|
53
|
+
m === 1 ? "source" : "sources"
|
|
54
54
|
] }),
|
|
55
55
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-tertiary", children: "·" }),
|
|
56
56
|
/* @__PURE__ */ e("span", { className: "text-xs text-tertiary tabular-nums", children: t }),
|
|
57
|
-
|
|
57
|
+
n != null && /* @__PURE__ */ r(q, { children: [
|
|
58
58
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-tertiary", children: "·" }),
|
|
59
59
|
/* @__PURE__ */ r("span", { className: "text-xs text-tertiary", children: [
|
|
60
60
|
"first insight",
|
|
61
61
|
" ",
|
|
62
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums", children:
|
|
62
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: n })
|
|
63
63
|
] })
|
|
64
64
|
] })
|
|
65
65
|
] });
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const oe = s.forwardRef(
|
|
68
68
|
({
|
|
69
69
|
status: t,
|
|
70
|
-
elapsed:
|
|
71
|
-
sourceCount:
|
|
72
|
-
firstInsight:
|
|
70
|
+
elapsed: n,
|
|
71
|
+
sourceCount: m,
|
|
72
|
+
firstInsight: k,
|
|
73
73
|
sticky: h = !1,
|
|
74
74
|
collapsible: x = !0,
|
|
75
|
-
activityPlacement:
|
|
75
|
+
activityPlacement: C = "top",
|
|
76
76
|
activity: c,
|
|
77
|
-
activityKey:
|
|
78
|
-
stepIndex:
|
|
79
|
-
stepCount:
|
|
77
|
+
activityKey: G,
|
|
78
|
+
stepIndex: E,
|
|
79
|
+
stepCount: S,
|
|
80
80
|
icon: v,
|
|
81
81
|
summary: y,
|
|
82
|
-
open:
|
|
83
|
-
defaultOpen:
|
|
82
|
+
open: z,
|
|
83
|
+
defaultOpen: H = !1,
|
|
84
84
|
onOpenChange: a,
|
|
85
|
-
children:
|
|
86
|
-
className:
|
|
87
|
-
role:
|
|
88
|
-
"aria-label":
|
|
89
|
-
"aria-busy":
|
|
90
|
-
...
|
|
91
|
-
},
|
|
92
|
-
const d =
|
|
93
|
-
!i && t === "active" ||
|
|
94
|
-
),
|
|
95
|
-
|
|
96
|
-
var M,
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
|
|
85
|
+
children: I,
|
|
86
|
+
className: J,
|
|
87
|
+
role: Q,
|
|
88
|
+
"aria-label": U,
|
|
89
|
+
"aria-busy": W,
|
|
90
|
+
...X
|
|
91
|
+
}, Y) => {
|
|
92
|
+
const d = z !== void 0, i = c != null, [Z, b] = s.useState(
|
|
93
|
+
!i && t === "active" || H
|
|
94
|
+
), A = s.useRef(t), g = s.useRef(!1), j = s.useRef(null), N = s.useRef(null), w = d ? z : Z, p = !i && t === "active" || w, f = C === "bottom" && p;
|
|
95
|
+
s.useLayoutEffect(() => {
|
|
96
|
+
var M, D;
|
|
97
|
+
const u = A.current;
|
|
98
|
+
if (A.current = t, t === "active") {
|
|
99
|
+
u !== "active" && (g.current = !1), u !== "active" && !i && !d && b(!0);
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
if (
|
|
102
|
+
if (u !== "active" || g.current && i) return;
|
|
103
103
|
const L = document.activeElement;
|
|
104
|
-
L && ((M = j.current) != null && M.contains(L)) && ((
|
|
104
|
+
L && ((M = j.current) != null && M.contains(L)) && ((D = N.current) == null || D.focus()), d || b(!1), a == null || a(!1);
|
|
105
105
|
}, [i, d, a, t]);
|
|
106
|
-
const
|
|
107
|
-
(
|
|
108
|
-
!i && t !== "complete" || (
|
|
106
|
+
const _ = s.useCallback(
|
|
107
|
+
(u) => {
|
|
108
|
+
!i && t !== "complete" || (g.current = !0, d || b(u), a == null || a(u));
|
|
109
109
|
},
|
|
110
110
|
[i, d, a, t]
|
|
111
|
-
),
|
|
111
|
+
), l = t === "active", R = l ? /* @__PURE__ */ e(P, { stage: "thinking", status: "active" }) : /* @__PURE__ */ e(P, { outcome: "completed" }), O = l ? `activity-${G ?? (typeof c == "string" ? c : "current")}` : "summary";
|
|
112
112
|
return /* @__PURE__ */ r(
|
|
113
113
|
ae,
|
|
114
114
|
{
|
|
115
|
-
ref:
|
|
116
|
-
open:
|
|
117
|
-
onOpenChange:
|
|
118
|
-
role:
|
|
119
|
-
"aria-label":
|
|
120
|
-
"aria-busy":
|
|
121
|
-
...
|
|
115
|
+
ref: Y,
|
|
116
|
+
open: p,
|
|
117
|
+
onOpenChange: _,
|
|
118
|
+
role: Q ?? "group",
|
|
119
|
+
"aria-label": U ?? "Research activity",
|
|
120
|
+
"aria-busy": W ?? (l || void 0),
|
|
121
|
+
...X,
|
|
122
122
|
"data-slot": "research-activity",
|
|
123
123
|
"data-status": t,
|
|
124
|
-
className:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
className: o(
|
|
125
|
+
ne({ status: t }),
|
|
126
|
+
f && "flex flex-col",
|
|
127
|
+
J
|
|
128
128
|
),
|
|
129
129
|
children: [
|
|
130
|
-
/* @__PURE__ */ e("span", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children:
|
|
131
|
-
i ? /* @__PURE__ */ e(
|
|
130
|
+
/* @__PURE__ */ e("span", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: l ? "Research in progress" : "Research complete" }),
|
|
131
|
+
i ? /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ r(
|
|
132
132
|
"button",
|
|
133
133
|
{
|
|
134
|
-
ref:
|
|
134
|
+
ref: N,
|
|
135
135
|
type: "button",
|
|
136
136
|
"data-slot": "research-activity-trigger",
|
|
137
|
-
className:
|
|
137
|
+
className: o(
|
|
138
138
|
"group/research-trigger flex min-h-9 w-full cursor-pointer items-center gap-2.5 rounded-sm py-1 text-left text-base outline-none",
|
|
139
|
-
"transition-colors duration-
|
|
139
|
+
"transition-colors duration-150 ease-out hover:text-primary",
|
|
140
140
|
"focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none",
|
|
141
141
|
h && "sticky z-10 bg-background",
|
|
142
|
-
h && (
|
|
143
|
-
|
|
142
|
+
h && (f ? "bottom-0" : "top-0"),
|
|
143
|
+
f && "order-last mt-3"
|
|
144
144
|
),
|
|
145
145
|
children: [
|
|
146
146
|
/* @__PURE__ */ r("span", { className: "sr-only", children: [
|
|
147
|
-
|
|
147
|
+
p ? "Collapse" : "Expand",
|
|
148
148
|
" research activity:",
|
|
149
149
|
" "
|
|
150
150
|
] }),
|
|
151
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex size-4 shrink-0 items-center justify-center", children: v ??
|
|
151
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex size-4 shrink-0 items-center justify-center", children: v ?? R }),
|
|
152
152
|
/* @__PURE__ */ e(ee, { reducedMotion: "user", children: /* @__PURE__ */ e("span", { className: "relative h-5 min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ e(te, { initial: !1, children: /* @__PURE__ */ e(
|
|
153
|
-
|
|
153
|
+
T.span,
|
|
154
154
|
{
|
|
155
|
-
variants:
|
|
155
|
+
variants: le,
|
|
156
156
|
initial: "initial",
|
|
157
157
|
animate: "animate",
|
|
158
158
|
exit: "exit",
|
|
159
159
|
className: "absolute inset-0 flex items-center truncate whitespace-nowrap",
|
|
160
|
-
children:
|
|
161
|
-
|
|
160
|
+
children: l ? typeof c == "string" ? /* @__PURE__ */ e(K, { as: "span", className: "truncate text-base", children: c }) : c : y !== void 0 ? y : /* @__PURE__ */ e(
|
|
161
|
+
$,
|
|
162
162
|
{
|
|
163
|
-
elapsed:
|
|
164
|
-
firstInsight:
|
|
165
|
-
sourceCount:
|
|
163
|
+
elapsed: n,
|
|
164
|
+
firstInsight: k,
|
|
165
|
+
sourceCount: m
|
|
166
166
|
}
|
|
167
167
|
)
|
|
168
168
|
},
|
|
169
169
|
O
|
|
170
170
|
) }) }) }),
|
|
171
|
-
|
|
171
|
+
l && /* @__PURE__ */ r("span", { className: o(
|
|
172
172
|
"shrink-0 text-xs text-tertiary tabular-nums",
|
|
173
173
|
// Reserve the caret slot (size-4 + gap-2) so trailing metadata
|
|
174
174
|
// keeps the same right edge as sibling rows that show a caret.
|
|
175
175
|
!x && "pe-6"
|
|
176
176
|
), children: [
|
|
177
|
-
|
|
177
|
+
E != null && S != null && /* @__PURE__ */ r(q, { children: [
|
|
178
178
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Step " }),
|
|
179
|
-
|
|
179
|
+
E,
|
|
180
180
|
" of ",
|
|
181
|
-
|
|
181
|
+
S,
|
|
182
182
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, children: " · " })
|
|
183
183
|
] }),
|
|
184
184
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Elapsed " }),
|
|
185
|
-
|
|
185
|
+
n
|
|
186
186
|
] }),
|
|
187
187
|
x && /* @__PURE__ */ e(
|
|
188
|
-
|
|
188
|
+
B,
|
|
189
189
|
{
|
|
190
190
|
"aria-hidden": !0,
|
|
191
|
-
className:
|
|
192
|
-
"size-4 shrink-0 text-tertiary transition-transform duration-
|
|
193
|
-
|
|
191
|
+
className: o(
|
|
192
|
+
"size-4 shrink-0 text-tertiary transition-transform duration-200 ease-out motion-reduce:transition-none",
|
|
193
|
+
p && "rotate-180"
|
|
194
194
|
)
|
|
195
195
|
}
|
|
196
196
|
)
|
|
197
197
|
]
|
|
198
198
|
}
|
|
199
|
-
) }) :
|
|
199
|
+
) }) : l ? /* @__PURE__ */ r(
|
|
200
200
|
"div",
|
|
201
201
|
{
|
|
202
202
|
"data-slot": "research-activity-header",
|
|
203
203
|
className: "flex min-h-9 w-full items-center gap-2.5 py-1 text-left",
|
|
204
204
|
children: [
|
|
205
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex size-4 shrink-0 items-center justify-center", children: v ??
|
|
206
|
-
/* @__PURE__ */ e(
|
|
207
|
-
/* @__PURE__ */ r("span", { className:
|
|
205
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex size-4 shrink-0 items-center justify-center", children: v ?? R }),
|
|
206
|
+
/* @__PURE__ */ e(K, { as: "span", className: "text-base", children: "Researching…" }),
|
|
207
|
+
/* @__PURE__ */ r("span", { className: o(
|
|
208
208
|
"ml-auto shrink-0 text-xs text-tertiary tabular-nums",
|
|
209
209
|
!x && "pe-6"
|
|
210
210
|
), children: [
|
|
211
211
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Elapsed " }),
|
|
212
|
-
|
|
212
|
+
n
|
|
213
213
|
] })
|
|
214
214
|
]
|
|
215
215
|
}
|
|
216
|
-
) : /* @__PURE__ */ e(
|
|
216
|
+
) : /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ r(
|
|
217
217
|
"button",
|
|
218
218
|
{
|
|
219
|
-
ref:
|
|
219
|
+
ref: N,
|
|
220
220
|
type: "button",
|
|
221
221
|
"data-slot": "research-activity-trigger",
|
|
222
|
-
className:
|
|
222
|
+
className: o(
|
|
223
223
|
"group/research-trigger flex min-h-9 w-full cursor-pointer items-center gap-2 rounded-sm py-1 text-left text-base outline-none",
|
|
224
|
-
"transition-colors duration-
|
|
224
|
+
"transition-colors duration-150 ease-out hover:text-primary",
|
|
225
225
|
"focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none",
|
|
226
226
|
h && "sticky z-10 bg-background",
|
|
227
|
-
h && (
|
|
228
|
-
|
|
227
|
+
h && (f ? "bottom-0" : "top-0"),
|
|
228
|
+
f && "order-last mt-3"
|
|
229
229
|
),
|
|
230
230
|
children: [
|
|
231
231
|
/* @__PURE__ */ r("span", { className: "sr-only", children: [
|
|
232
|
-
|
|
232
|
+
w ? "Collapse" : "Expand",
|
|
233
233
|
" research activity:",
|
|
234
234
|
" "
|
|
235
235
|
] }),
|
|
236
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex size-4 shrink-0 items-center justify-center", children: v ??
|
|
236
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex size-4 shrink-0 items-center justify-center", children: v ?? R }),
|
|
237
237
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: y !== void 0 ? y : /* @__PURE__ */ e(
|
|
238
|
-
|
|
238
|
+
$,
|
|
239
239
|
{
|
|
240
|
-
elapsed:
|
|
241
|
-
firstInsight:
|
|
242
|
-
sourceCount:
|
|
240
|
+
elapsed: n,
|
|
241
|
+
firstInsight: k,
|
|
242
|
+
sourceCount: m
|
|
243
243
|
}
|
|
244
244
|
) }),
|
|
245
245
|
x && /* @__PURE__ */ e(
|
|
246
|
-
|
|
246
|
+
B,
|
|
247
247
|
{
|
|
248
248
|
"aria-hidden": !0,
|
|
249
|
-
className:
|
|
250
|
-
"size-4 shrink-0 text-tertiary transition-transform duration-
|
|
251
|
-
|
|
249
|
+
className: o(
|
|
250
|
+
"size-4 shrink-0 text-tertiary transition-transform duration-200 ease-out motion-reduce:transition-none",
|
|
251
|
+
w && "rotate-180"
|
|
252
252
|
)
|
|
253
253
|
}
|
|
254
254
|
)
|
|
@@ -256,18 +256,18 @@ const le = n.forwardRef(
|
|
|
256
256
|
}
|
|
257
257
|
) }),
|
|
258
258
|
/* @__PURE__ */ e(ie, { forceMount: !0, asChild: !0, "data-slot": "research-activity-content", children: /* @__PURE__ */ e(
|
|
259
|
-
|
|
259
|
+
T.div,
|
|
260
260
|
{
|
|
261
261
|
ref: j,
|
|
262
262
|
initial: !1,
|
|
263
|
-
animate:
|
|
263
|
+
animate: p ? "open" : "closed",
|
|
264
264
|
variants: {
|
|
265
265
|
open: { height: "auto", opacity: 1 },
|
|
266
266
|
closed: { height: 0, opacity: 0 }
|
|
267
267
|
},
|
|
268
|
-
transition:
|
|
268
|
+
transition: se,
|
|
269
269
|
className: "overflow-hidden text-secondary outline-none data-[state=closed]:pointer-events-none",
|
|
270
|
-
children: /* @__PURE__ */ e("div", { className: "ml-2 pt-3 [--tree-rail-lead:20px]", children:
|
|
270
|
+
children: /* @__PURE__ */ e("div", { className: "ml-2 pt-3 [--tree-rail-lead:20px]", children: I })
|
|
271
271
|
}
|
|
272
272
|
) })
|
|
273
273
|
]
|
|
@@ -275,7 +275,7 @@ const le = n.forwardRef(
|
|
|
275
275
|
);
|
|
276
276
|
}
|
|
277
277
|
);
|
|
278
|
-
|
|
278
|
+
oe.displayName = "ResearchActivity";
|
|
279
279
|
export {
|
|
280
|
-
|
|
280
|
+
oe as ResearchActivity
|
|
281
281
|
};
|
|
@@ -11,8 +11,8 @@ import { ElementType, JSX } from 'react';
|
|
|
11
11
|
* (compiled away, not emitted at runtime) — so this port reads the raw `:root`
|
|
12
12
|
* tokens instead.
|
|
13
13
|
*
|
|
14
|
-
* It is a continuous ambient loop (like `Spinner`
|
|
15
|
-
*
|
|
14
|
+
* It is a continuous ambient loop (like `Spinner`), so its local `linear`
|
|
15
|
+
* timing is intentional.
|
|
16
16
|
* Reduced-motion viewers get the static muted text with no sweep.
|
|
17
17
|
*/
|
|
18
18
|
export type TextShimmerProps = {
|
|
@@ -14,8 +14,8 @@ const Z = () => window.SpeechRecognition ?? window.webkitSpeechRecognition, $ =
|
|
|
14
14
|
disabled: F,
|
|
15
15
|
...O
|
|
16
16
|
}) => {
|
|
17
|
-
const [s, d] = b(!1), [L, z] = b(!1), [o] = b($), [T, N] = b(!1), p = l(null),
|
|
18
|
-
u.current = M, h.current = R,
|
|
17
|
+
const [s, d] = b(!1), [L, z] = b(!1), [o] = b($), [T, N] = b(!1), p = l(null), m = l(null), g = l(null), y = l([]), u = l(M), h = l(R), r = l(x);
|
|
18
|
+
u.current = M, h.current = R, r.current = x, Y(() => {
|
|
19
19
|
if (o !== "speech-recognition")
|
|
20
20
|
return;
|
|
21
21
|
const t = Z();
|
|
@@ -23,18 +23,18 @@ const Z = () => window.SpeechRecognition ?? window.webkitSpeechRecognition, $ =
|
|
|
23
23
|
return;
|
|
24
24
|
const e = new t();
|
|
25
25
|
e.continuous = !0, e.interimResults = !0, e.lang = D;
|
|
26
|
-
const c = () => d(!0), v = () => d(!1), w = (
|
|
26
|
+
const c = () => d(!0), v = () => d(!1), w = (n) => {
|
|
27
27
|
var A, G;
|
|
28
|
-
const i =
|
|
28
|
+
const i = n;
|
|
29
29
|
let a = "";
|
|
30
30
|
for (let k = i.resultIndex; k < i.results.length; k += 1) {
|
|
31
31
|
const P = i.results[k];
|
|
32
32
|
P.isFinal && (a += ((A = P[0]) == null ? void 0 : A.transcript) ?? "");
|
|
33
33
|
}
|
|
34
34
|
a && ((G = u.current) == null || G.call(u, a));
|
|
35
|
-
}, S = (
|
|
35
|
+
}, S = (n) => {
|
|
36
36
|
var i;
|
|
37
|
-
d(!1), (i =
|
|
37
|
+
d(!1), (i = r.current) == null || i.call(r, n.error);
|
|
38
38
|
};
|
|
39
39
|
return e.addEventListener("start", c), e.addEventListener("end", v), e.addEventListener("result", w), e.addEventListener("error", S), p.current = e, N(!0), () => {
|
|
40
40
|
e.removeEventListener("start", c), e.removeEventListener("end", v), e.removeEventListener("result", w), e.removeEventListener("error", S), e.stop(), p.current = null, N(!1);
|
|
@@ -42,8 +42,8 @@ const Z = () => window.SpeechRecognition ?? window.webkitSpeechRecognition, $ =
|
|
|
42
42
|
}, [o, D]), Y(
|
|
43
43
|
() => () => {
|
|
44
44
|
var t;
|
|
45
|
-
if (((t =
|
|
46
|
-
for (const e of
|
|
45
|
+
if (((t = m.current) == null ? void 0 : t.state) === "recording" && m.current.stop(), g.current)
|
|
46
|
+
for (const e of g.current.getTracks())
|
|
47
47
|
e.stop();
|
|
48
48
|
},
|
|
49
49
|
[]
|
|
@@ -53,23 +53,23 @@ const Z = () => window.SpeechRecognition ?? window.webkitSpeechRecognition, $ =
|
|
|
53
53
|
if (h.current)
|
|
54
54
|
try {
|
|
55
55
|
const e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
56
|
-
|
|
56
|
+
g.current = e;
|
|
57
57
|
const c = new MediaRecorder(e);
|
|
58
58
|
y.current = [];
|
|
59
|
-
const v = (
|
|
60
|
-
|
|
59
|
+
const v = (n) => {
|
|
60
|
+
n.data.size > 0 && y.current.push(n.data);
|
|
61
61
|
}, w = async () => {
|
|
62
62
|
var i;
|
|
63
63
|
for (const a of e.getTracks())
|
|
64
64
|
a.stop();
|
|
65
|
-
|
|
66
|
-
const
|
|
65
|
+
g.current = null;
|
|
66
|
+
const n = new Blob(y.current, {
|
|
67
67
|
type: "audio/webm"
|
|
68
68
|
});
|
|
69
|
-
if (
|
|
69
|
+
if (n.size > 0 && h.current) {
|
|
70
70
|
z(!0);
|
|
71
71
|
try {
|
|
72
|
-
const a = await h.current(
|
|
72
|
+
const a = await h.current(n);
|
|
73
73
|
a && ((i = u.current) == null || i.call(u, a));
|
|
74
74
|
} catch {
|
|
75
75
|
} finally {
|
|
@@ -78,20 +78,20 @@ const Z = () => window.SpeechRecognition ?? window.webkitSpeechRecognition, $ =
|
|
|
78
78
|
}
|
|
79
79
|
}, S = () => {
|
|
80
80
|
d(!1);
|
|
81
|
-
for (const
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
for (const n of e.getTracks())
|
|
82
|
+
n.stop();
|
|
83
|
+
g.current = null;
|
|
84
84
|
};
|
|
85
|
-
c.addEventListener("dataavailable", v), c.addEventListener("stop", w), c.addEventListener("error", S),
|
|
85
|
+
c.addEventListener("dataavailable", v), c.addEventListener("stop", w), c.addEventListener("error", S), m.current = c, c.start(), d(!0);
|
|
86
86
|
} catch (e) {
|
|
87
|
-
d(!1), (t =
|
|
88
|
-
|
|
87
|
+
d(!1), (t = r.current) == null || t.call(
|
|
88
|
+
r,
|
|
89
89
|
e instanceof Error ? e.name : "not-allowed"
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
}, []), B = I(() => {
|
|
93
93
|
var t;
|
|
94
|
-
((t =
|
|
94
|
+
((t = m.current) == null ? void 0 : t.state) === "recording" && m.current.stop(), d(!1);
|
|
95
95
|
}, []), q = I(() => {
|
|
96
96
|
var t;
|
|
97
97
|
if (o === "speech-recognition" && p.current)
|
|
@@ -101,8 +101,8 @@ const Z = () => window.SpeechRecognition ?? window.webkitSpeechRecognition, $ =
|
|
|
101
101
|
try {
|
|
102
102
|
p.current.start();
|
|
103
103
|
} catch (e) {
|
|
104
|
-
(t =
|
|
105
|
-
|
|
104
|
+
(t = r.current) == null || t.call(
|
|
105
|
+
r,
|
|
106
106
|
e instanceof Error ? e.name : "not-allowed"
|
|
107
107
|
);
|
|
108
108
|
}
|
|
@@ -111,15 +111,15 @@ const Z = () => window.SpeechRecognition ?? window.webkitSpeechRecognition, $ =
|
|
|
111
111
|
return /* @__PURE__ */ J("div", { className: "relative inline-flex items-center justify-center", children: [
|
|
112
112
|
s && [
|
|
113
113
|
"",
|
|
114
|
-
"[animation-delay:
|
|
115
|
-
"[animation-delay:
|
|
114
|
+
"[animation-delay:200ms]",
|
|
115
|
+
"[animation-delay:300ms]"
|
|
116
116
|
].map((t, e) => /* @__PURE__ */ f(
|
|
117
117
|
"span",
|
|
118
118
|
{
|
|
119
119
|
"aria-hidden": !0,
|
|
120
120
|
className: _(
|
|
121
121
|
"absolute inset-0 animate-ping rounded-full bg-danger/20",
|
|
122
|
-
"[animation-duration:
|
|
122
|
+
"[animation-duration:1.5s] motion-reduce:hidden",
|
|
123
123
|
t
|
|
124
124
|
)
|
|
125
125
|
},
|
|
@@ -141,7 +141,7 @@ const Z = () => window.SpeechRecognition ?? window.webkitSpeechRecognition, $ =
|
|
|
141
141
|
variant: "secondary",
|
|
142
142
|
...O,
|
|
143
143
|
onClick: q,
|
|
144
|
-
children: L ? /* @__PURE__ */ f(Q, { size: "sm" }) : s ? /* @__PURE__ */ f(V, {}) : E ? /* @__PURE__ */ f(W, {}) : /* @__PURE__ */ f(X, {})
|
|
144
|
+
children: L ? /* @__PURE__ */ f(Q, { variant: "action", size: "sm", "aria-hidden": !0 }) : s ? /* @__PURE__ */ f(V, {}) : E ? /* @__PURE__ */ f(W, {}) : /* @__PURE__ */ f(X, {})
|
|
145
145
|
}
|
|
146
146
|
)
|
|
147
147
|
] });
|