@actioneer/ads 0.6.0 → 0.7.0
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/agent-trace.d.ts +2 -2
- package/components/ai-elements/agent-trace.js +163 -104
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +1 -1
- package/components/ai-elements/index.d.ts +0 -5
- package/components/ai-elements/inline-citation.js +1 -1
- package/components/alert.d.ts +6 -6
- package/components/alert.js +89 -53
- package/components/answer-sources.d.ts +2 -6
- package/components/answer-sources.js +58 -60
- package/components/answer.d.ts +5 -0
- package/components/answer.js +311 -271
- package/components/assistant-ui/composer-harness.js +15 -20
- package/components/assistant-ui/composer.d.ts +3 -1
- package/components/assistant-ui/composer.js +148 -144
- package/components/assistant-ui/index.d.ts +0 -3
- package/components/assistant-ui/thread-context.d.ts +3 -1
- package/components/assistant-ui/thread.js +50 -42
- package/components/avatar.js +42 -42
- package/components/badge.d.ts +5 -6
- package/components/badge.js +13 -76
- package/components/body-page-header.d.ts +15 -0
- package/components/body-page-header.js +24 -0
- package/components/brand-loader.d.ts +0 -3
- package/components/brand-loader.js +10 -32
- package/components/breadcrumbs.d.ts +0 -7
- package/components/breadcrumbs.js +54 -71
- package/components/button.d.ts +1 -1
- package/components/button.js +55 -49
- package/components/chart.js +298 -296
- package/components/chip.d.ts +13 -1
- package/components/chip.js +93 -80
- package/components/collection-header.d.ts +17 -0
- package/components/collection-header.js +31 -0
- package/components/connector-card.d.ts +6 -6
- package/components/connector-card.js +31 -32
- package/components/date-range-picker.d.ts +2 -1
- package/components/date-range-picker.js +158 -122
- package/components/drawer.d.ts +19 -3
- package/components/drawer.js +109 -100
- package/components/dropdown.d.ts +1 -2
- package/components/dropdown.js +88 -89
- package/components/field.js +39 -34
- package/components/file-dropzone.js +1 -1
- package/components/index.d.ts +4 -4
- package/components/index.js +499 -546
- package/components/infinite-canvas.js +24 -24
- package/components/input-field.d.ts +18 -3
- package/components/input-field.js +88 -72
- package/components/input.js +16 -15
- package/components/modal.d.ts +31 -3
- package/components/modal.js +243 -169
- package/components/number-field.js +45 -42
- package/components/page-body.d.ts +12 -0
- package/components/page-body.js +18 -0
- package/components/pagination.js +36 -36
- package/components/select.d.ts +21 -0
- package/components/select.js +189 -148
- package/components/setting-row.d.ts +6 -5
- package/components/setting-row.js +33 -32
- package/components/sidebar.d.ts +2 -0
- package/components/sidebar.js +165 -155
- package/components/skeleton.js +8 -7
- package/components/slider.js +1 -1
- package/components/surface-loader.d.ts +11 -0
- package/components/surface-loader.js +35 -0
- package/components/table.d.ts +16 -10
- package/components/table.js +426 -410
- package/components/tabs.d.ts +2 -0
- package/components/tabs.js +159 -294
- package/components/textarea.js +9 -9
- package/components/toast.d.ts +1 -1
- package/components/toast.js +181 -118
- package/components/tree.d.ts +5 -1
- package/components/tree.js +54 -49
- package/components/typography.d.ts +4 -4
- package/components/typography.js +13 -13
- package/components/ui/button.d.ts +1 -1
- package/components/ui/dialog.js +33 -33
- package/demo/components/add-to-artifact.js +6 -10
- package/lib/cn.js +11 -4
- package/lib/icons.d.ts +4 -0
- package/lib/icons.js +107 -106
- package/lib/interactive.d.ts +1 -1
- package/llms.txt +95 -152
- package/manifest.json +1628 -2729
- package/package.json +1 -2
- package/styles.css +347 -223
- package/theme.css +303 -177
- package/components/agent-icon.d.ts +0 -76
- package/components/agent-icon.js +0 -265
- package/components/ai-elements/queue.d.ts +0 -60
- package/components/ai-elements/queue.js +0 -193
- package/components/ai-elements/speech-input.d.ts +0 -16
- package/components/ai-elements/speech-input.js +0 -151
- package/components/ai-elements/task-progress.d.ts +0 -41
- package/components/ai-elements/task-progress.js +0 -224
- package/components/ai-elements/task.d.ts +0 -39
- package/components/ai-elements/task.js +0 -105
- package/components/ai-elements/voice.d.ts +0 -90
- package/components/ai-elements/voice.js +0 -496
- package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
- package/components/assistant-ui/follow-up-suggestions.js +0 -72
- package/components/assistant-ui/suggestions.d.ts +0 -7
- package/components/assistant-ui/suggestions.js +0 -19
- package/components/assistant-ui/voice.d.ts +0 -18
- package/components/link.d.ts +0 -14
- package/components/link.js +0 -72
- package/components/navbar.d.ts +0 -15
- package/components/navbar.js +0 -68
- package/components/pixel-icon.d.ts +0 -37
- package/components/pixel-icon.js +0 -859
|
@@ -1,496 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as a, jsxs as G, Fragment as X } from "react/jsx-runtime";
|
|
3
|
-
import * as i from "react";
|
|
4
|
-
import { useReducedMotion as $ } from "motion/react";
|
|
5
|
-
import { cn as R } from "../../lib/cn.js";
|
|
6
|
-
import { Button as U } from "../button.js";
|
|
7
|
-
import { Tooltip as H } from "../tooltip.js";
|
|
8
|
-
import { Call as J, PhoneOff as Q, MicOff as Z, Mic as ee } from "../../lib/icons.js";
|
|
9
|
-
const be = [
|
|
10
|
-
"default",
|
|
11
|
-
"identity",
|
|
12
|
-
"blue",
|
|
13
|
-
"violet",
|
|
14
|
-
"emerald",
|
|
15
|
-
"sunset"
|
|
16
|
-
], Re = ["orb"], we = [
|
|
17
|
-
"idle",
|
|
18
|
-
"connecting",
|
|
19
|
-
"listening",
|
|
20
|
-
"thinking",
|
|
21
|
-
"speaking",
|
|
22
|
-
"muted",
|
|
23
|
-
"asleep"
|
|
24
|
-
], te = {
|
|
25
|
-
/**
|
|
26
|
-
* Base colours for `seed`-derived hues. The shader rotates these by u_hue,
|
|
27
|
-
* so each seed lands on its own colourway from one shared spectrum.
|
|
28
|
-
*/
|
|
29
|
-
identity: [
|
|
30
|
-
[0.08, 0.78, 1],
|
|
31
|
-
[0.58, 0.24, 1],
|
|
32
|
-
[1, 0.16, 0.58]
|
|
33
|
-
],
|
|
34
|
-
default: [
|
|
35
|
-
[0.08, 0.78, 1],
|
|
36
|
-
[0.58, 0.24, 1],
|
|
37
|
-
[1, 0.16, 0.58]
|
|
38
|
-
],
|
|
39
|
-
blue: [
|
|
40
|
-
[0.05, 0.82, 1],
|
|
41
|
-
[0.1, 0.38, 1],
|
|
42
|
-
[0.2, 0.08, 0.78]
|
|
43
|
-
],
|
|
44
|
-
violet: [
|
|
45
|
-
[0.52, 0.18, 1],
|
|
46
|
-
[1, 0.22, 0.78],
|
|
47
|
-
[0.15, 0.75, 1]
|
|
48
|
-
],
|
|
49
|
-
emerald: [
|
|
50
|
-
[0.08, 0.9, 0.55],
|
|
51
|
-
[0.05, 0.72, 1],
|
|
52
|
-
[0.68, 1, 0.15]
|
|
53
|
-
],
|
|
54
|
-
sunset: [
|
|
55
|
-
[1, 0.42, 0.06],
|
|
56
|
-
[1, 0.12, 0.46],
|
|
57
|
-
[0.58, 0.18, 1]
|
|
58
|
-
]
|
|
59
|
-
}, v = {
|
|
60
|
-
idle: { speed: 0.15, amplitude: 0.04, glow: 0.15, brightness: 0.55, pulse: 0, saturation: 0.7 },
|
|
61
|
-
connecting: { speed: 0.5, amplitude: 0.1, glow: 0.45, brightness: 0.75, pulse: 1, saturation: 0.9 },
|
|
62
|
-
listening: { speed: 0.4, amplitude: 0.14, glow: 0.5, brightness: 0.85, pulse: 0, saturation: 1 },
|
|
63
|
-
speaking: { speed: 1.4, amplitude: 0.35, glow: 0.9, brightness: 1, pulse: 0, saturation: 1 },
|
|
64
|
-
muted: { speed: 0.06, amplitude: 0.015, glow: 0.08, brightness: 0.35, pulse: 0, saturation: 0.2 }
|
|
65
|
-
}, F = {
|
|
66
|
-
idle: v.idle,
|
|
67
|
-
connecting: v.connecting,
|
|
68
|
-
listening: v.listening,
|
|
69
|
-
thinking: v.connecting,
|
|
70
|
-
speaking: v.speaking,
|
|
71
|
-
muted: v.muted,
|
|
72
|
-
asleep: { ...v.idle, brightness: 0.35, speed: 0.08 }
|
|
73
|
-
}, oe = `#version 300 es
|
|
74
|
-
in vec2 a_position;
|
|
75
|
-
out vec2 v_uv;
|
|
76
|
-
void main() {
|
|
77
|
-
v_uv = a_position * 0.5 + 0.5;
|
|
78
|
-
gl_Position = vec4(a_position, 0.0, 1.0);
|
|
79
|
-
}`, ne = `#version 300 es
|
|
80
|
-
precision highp float;
|
|
81
|
-
|
|
82
|
-
in vec2 v_uv;
|
|
83
|
-
out vec4 fragColor;
|
|
84
|
-
|
|
85
|
-
uniform float u_time;
|
|
86
|
-
uniform float u_speed;
|
|
87
|
-
uniform float u_amplitude;
|
|
88
|
-
uniform float u_glow;
|
|
89
|
-
uniform float u_brightness;
|
|
90
|
-
uniform float u_pulse;
|
|
91
|
-
uniform float u_saturation;
|
|
92
|
-
uniform float u_seed;
|
|
93
|
-
uniform float u_hue;
|
|
94
|
-
uniform float u_radius;
|
|
95
|
-
uniform vec3 u_color0;
|
|
96
|
-
uniform vec3 u_color1;
|
|
97
|
-
uniform vec3 u_color2;
|
|
98
|
-
uniform float u_dpr;
|
|
99
|
-
|
|
100
|
-
// Simplex-like noise (3D)
|
|
101
|
-
vec3 mod289(vec3 x) { return x - floor(x / 289.0) * 289.0; }
|
|
102
|
-
vec4 mod289(vec4 x) { return x - floor(x / 289.0) * 289.0; }
|
|
103
|
-
vec4 permute(vec4 x) { return mod289((x * 34.0 + 1.0) * x); }
|
|
104
|
-
vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }
|
|
105
|
-
|
|
106
|
-
/** Rotate an RGB triple around the grey axis — used for per-identity hues. */
|
|
107
|
-
vec3 hueRotate(vec3 c, float a) {
|
|
108
|
-
const vec3 k = vec3(0.57735026);
|
|
109
|
-
float ca = cos(a);
|
|
110
|
-
return c * ca + cross(k, c) * sin(a) + k * dot(k, c) * (1.0 - ca);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
float snoise(vec3 v) {
|
|
114
|
-
const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);
|
|
115
|
-
vec3 i = floor(v + dot(v, vec3(C.y)));
|
|
116
|
-
vec3 x0 = v - i + dot(i, vec3(C.x));
|
|
117
|
-
vec3 g = step(x0.yzx, x0.xyz);
|
|
118
|
-
vec3 l = 1.0 - g;
|
|
119
|
-
vec3 i1 = min(g, l.zxy);
|
|
120
|
-
vec3 i2 = max(g, l.zxy);
|
|
121
|
-
vec3 x1 = x0 - i1 + C.x;
|
|
122
|
-
vec3 x2 = x0 - i2 + C.y;
|
|
123
|
-
vec3 x3 = x0 - 0.5;
|
|
124
|
-
i = mod289(i);
|
|
125
|
-
vec4 p = permute(permute(permute(
|
|
126
|
-
i.z + vec4(0.0, i1.z, i2.z, 1.0))
|
|
127
|
-
+ i.y + vec4(0.0, i1.y, i2.y, 1.0))
|
|
128
|
-
+ i.x + vec4(0.0, i1.x, i2.x, 1.0));
|
|
129
|
-
vec4 j = p - 49.0 * floor(p / 49.0);
|
|
130
|
-
vec4 x_ = floor(j / 7.0);
|
|
131
|
-
vec4 y_ = floor(j - 7.0 * x_);
|
|
132
|
-
vec4 x = (x_ * 2.0 + 0.5) / 7.0 - 1.0;
|
|
133
|
-
vec4 y = (y_ * 2.0 + 0.5) / 7.0 - 1.0;
|
|
134
|
-
vec4 h = 1.0 - abs(x) - abs(y);
|
|
135
|
-
vec4 b0 = vec4(x.xy, y.xy);
|
|
136
|
-
vec4 b1 = vec4(x.zw, y.zw);
|
|
137
|
-
vec4 s0 = floor(b0) * 2.0 + 1.0;
|
|
138
|
-
vec4 s1 = floor(b1) * 2.0 + 1.0;
|
|
139
|
-
vec4 sh = -step(h, vec4(0.0));
|
|
140
|
-
vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
|
|
141
|
-
vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
|
|
142
|
-
vec3 g0 = vec3(a0.xy, h.x);
|
|
143
|
-
vec3 g1 = vec3(a0.zw, h.y);
|
|
144
|
-
vec3 g2 = vec3(a1.xy, h.z);
|
|
145
|
-
vec3 g3 = vec3(a1.zw, h.w);
|
|
146
|
-
vec4 norm = taylorInvSqrt(vec4(dot(g0,g0), dot(g1,g1), dot(g2,g2), dot(g3,g3)));
|
|
147
|
-
g0 *= norm.x; g1 *= norm.y; g2 *= norm.z; g3 *= norm.w;
|
|
148
|
-
vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);
|
|
149
|
-
m = m * m;
|
|
150
|
-
return 42.0 * dot(m * m, vec4(dot(g0,x0), dot(g1,x1), dot(g2,x2), dot(g3,x3)));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
void main() {
|
|
154
|
-
vec2 uv = v_uv * 2.0 - 1.0;
|
|
155
|
-
float dist = length(uv);
|
|
156
|
-
float t = u_time * u_speed;
|
|
157
|
-
|
|
158
|
-
// Perfect circle — hard boundary, soft anti-aliased edge. u_radius is in
|
|
159
|
-
// uv units where the box edge midpoint is 1.0, so 0.44 is the legacy disc
|
|
160
|
-
// (transparent padding around it) and ~0.98 fills the box (fill mode).
|
|
161
|
-
float radius = u_radius;
|
|
162
|
-
float circle = 1.0 - smoothstep(radius - 0.008, radius + 0.008, dist);
|
|
163
|
-
|
|
164
|
-
if (circle < 0.001) {
|
|
165
|
-
// No halo behind the orb — everything outside the circle is fully
|
|
166
|
-
// transparent, so the orb reads as a clean disc with nothing cast behind it.
|
|
167
|
-
fragColor = vec4(0.0);
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// u_seed offsets only the noise sample coordinates, so an identity changes
|
|
172
|
-
// the internal pattern while the circle, glow and speculars stay identical.
|
|
173
|
-
float sx = u_seed * 13.7;
|
|
174
|
-
float sz = u_seed * 5.3;
|
|
175
|
-
|
|
176
|
-
float n1 = snoise(vec3(uv * 2.0 + sx, t * 0.6 + sz)) * 0.5 + 0.5;
|
|
177
|
-
float n2 = snoise(vec3(uv * 3.5 + 7.0 + sx, t * 0.9 + sz)) * 0.5 + 0.5;
|
|
178
|
-
float n3 = snoise(vec3(uv * 1.5 - 3.0 + sx, t * 0.4 + 10.0 + sz)) * 0.5 + 0.5;
|
|
179
|
-
|
|
180
|
-
vec2 distort = vec2(
|
|
181
|
-
snoise(vec3(uv * 2.0 + 5.0 + sx, t * 0.7 + sz)),
|
|
182
|
-
snoise(vec3(uv * 2.0 + 15.0 + sx, t * 0.7 + sz))
|
|
183
|
-
) * u_amplitude * 2.0;
|
|
184
|
-
float n4 = snoise(vec3((uv + distort) * 3.0 + sx, t * 0.5 + sz)) * 0.5 + 0.5;
|
|
185
|
-
|
|
186
|
-
vec3 col = mix(u_color0, u_color1, n1);
|
|
187
|
-
col = mix(col, u_color2, n2 * 0.5);
|
|
188
|
-
col = mix(col, u_color1 * 1.3, n4 * 0.4);
|
|
189
|
-
|
|
190
|
-
float vein = pow(n3, 3.0) * u_amplitude * 6.0;
|
|
191
|
-
col += vein * mix(u_color1, vec3(1.0), 0.3);
|
|
192
|
-
|
|
193
|
-
float centerDist = dist / radius;
|
|
194
|
-
float depthShade = 1.0 - centerDist * centerDist * 0.4;
|
|
195
|
-
col *= depthShade;
|
|
196
|
-
|
|
197
|
-
float rim = pow(centerDist, 4.0) * 0.6;
|
|
198
|
-
col += rim * mix(u_color0, vec3(1.0), 0.5);
|
|
199
|
-
|
|
200
|
-
vec2 lightPos = vec2(-0.15, -0.18);
|
|
201
|
-
float specDist = length(uv - lightPos);
|
|
202
|
-
float spec = exp(-specDist * specDist * 30.0) * 0.7;
|
|
203
|
-
col += spec * vec3(1.0);
|
|
204
|
-
|
|
205
|
-
vec2 lightPos2 = vec2(0.2, 0.25);
|
|
206
|
-
float spec2 = exp(-length(uv - lightPos2) * 8.0) * 0.15;
|
|
207
|
-
col += spec2 * u_color1;
|
|
208
|
-
|
|
209
|
-
float pulseFactor = 1.0 + u_pulse * sin(u_time * 3.5) * 0.35;
|
|
210
|
-
|
|
211
|
-
col = hueRotate(col, u_hue);
|
|
212
|
-
|
|
213
|
-
float lum = dot(col, vec3(0.299, 0.587, 0.114));
|
|
214
|
-
col = mix(vec3(lum), col, u_saturation);
|
|
215
|
-
|
|
216
|
-
col *= u_brightness * pulseFactor;
|
|
217
|
-
|
|
218
|
-
fragColor = vec4(col, circle);
|
|
219
|
-
}`;
|
|
220
|
-
function q(t, e, n) {
|
|
221
|
-
const u = t.createShader(e);
|
|
222
|
-
return u ? (t.shaderSource(u, n), t.compileShader(u), t.getShaderParameter(u, t.COMPILE_STATUS) ? u : (t.deleteShader(u), null)) : null;
|
|
223
|
-
}
|
|
224
|
-
function re(t) {
|
|
225
|
-
const e = t.getContext("webgl2", {
|
|
226
|
-
alpha: !0,
|
|
227
|
-
premultipliedAlpha: !1,
|
|
228
|
-
antialias: !0
|
|
229
|
-
});
|
|
230
|
-
if (!e) return null;
|
|
231
|
-
const n = q(e, e.VERTEX_SHADER, oe), u = q(e, e.FRAGMENT_SHADER, ne);
|
|
232
|
-
if (!n || !u) return null;
|
|
233
|
-
const o = e.createProgram();
|
|
234
|
-
if (e.attachShader(o, n), e.attachShader(o, u), e.linkProgram(o), !e.getProgramParameter(o, e.LINK_STATUS)) return null;
|
|
235
|
-
e.useProgram(o);
|
|
236
|
-
const l = e.createBuffer();
|
|
237
|
-
e.bindBuffer(e.ARRAY_BUFFER, l), e.bufferData(
|
|
238
|
-
e.ARRAY_BUFFER,
|
|
239
|
-
new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]),
|
|
240
|
-
e.STATIC_DRAW
|
|
241
|
-
);
|
|
242
|
-
const f = e.getAttribLocation(o, "a_position");
|
|
243
|
-
e.enableVertexAttribArray(f), e.vertexAttribPointer(f, 2, e.FLOAT, !1, 0, 0), e.enable(e.BLEND), e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA);
|
|
244
|
-
const d = {
|
|
245
|
-
u_time: e.getUniformLocation(o, "u_time"),
|
|
246
|
-
u_speed: e.getUniformLocation(o, "u_speed"),
|
|
247
|
-
u_amplitude: e.getUniformLocation(o, "u_amplitude"),
|
|
248
|
-
u_glow: e.getUniformLocation(o, "u_glow"),
|
|
249
|
-
u_brightness: e.getUniformLocation(o, "u_brightness"),
|
|
250
|
-
u_pulse: e.getUniformLocation(o, "u_pulse"),
|
|
251
|
-
u_saturation: e.getUniformLocation(o, "u_saturation"),
|
|
252
|
-
u_seed: e.getUniformLocation(o, "u_seed"),
|
|
253
|
-
u_hue: e.getUniformLocation(o, "u_hue"),
|
|
254
|
-
u_radius: e.getUniformLocation(o, "u_radius"),
|
|
255
|
-
u_color0: e.getUniformLocation(o, "u_color0"),
|
|
256
|
-
u_color1: e.getUniformLocation(o, "u_color1"),
|
|
257
|
-
u_color2: e.getUniformLocation(o, "u_color2"),
|
|
258
|
-
u_dpr: e.getUniformLocation(o, "u_dpr")
|
|
259
|
-
};
|
|
260
|
-
return { gl: e, uniforms: d };
|
|
261
|
-
}
|
|
262
|
-
function ie(t) {
|
|
263
|
-
if (t === void 0) return 0;
|
|
264
|
-
if (typeof t == "number") return t;
|
|
265
|
-
let e = 0;
|
|
266
|
-
for (let n = 0; n < t.length; n += 1)
|
|
267
|
-
e = (e << 5) - e + t.charCodeAt(n) | 0;
|
|
268
|
-
return Math.abs(e) % 1e3 / 1e3;
|
|
269
|
-
}
|
|
270
|
-
function b(t, e, n) {
|
|
271
|
-
return t + (e - t) * n;
|
|
272
|
-
}
|
|
273
|
-
const ce = i.memo(function({
|
|
274
|
-
state: e,
|
|
275
|
-
palette: n,
|
|
276
|
-
volume: u,
|
|
277
|
-
reduced: o,
|
|
278
|
-
seed: l,
|
|
279
|
-
hue: f,
|
|
280
|
-
radius: d
|
|
281
|
-
}) {
|
|
282
|
-
const w = i.useRef(0);
|
|
283
|
-
w.current = u;
|
|
284
|
-
const y = i.useRef(l);
|
|
285
|
-
y.current = l;
|
|
286
|
-
const A = i.useRef(f);
|
|
287
|
-
A.current = f;
|
|
288
|
-
const S = i.useRef(d);
|
|
289
|
-
S.current = d;
|
|
290
|
-
const C = i.useRef(o);
|
|
291
|
-
C.current = o;
|
|
292
|
-
const h = i.useRef(null), m = i.useRef(null), E = i.useRef(0), W = i.useRef(performance.now()), Y = i.useRef({ ...F.idle }), N = i.useRef({ ...F.idle });
|
|
293
|
-
i.useEffect(() => {
|
|
294
|
-
N.current = { ...F[e] };
|
|
295
|
-
}, [e]);
|
|
296
|
-
const O = te[n], B = i.useRef(O);
|
|
297
|
-
B.current = O;
|
|
298
|
-
const [I, M] = i.useState(!1);
|
|
299
|
-
i.useEffect(() => {
|
|
300
|
-
const g = requestAnimationFrame(() => M(!0));
|
|
301
|
-
return () => {
|
|
302
|
-
cancelAnimationFrame(g), M(!1);
|
|
303
|
-
};
|
|
304
|
-
}, []);
|
|
305
|
-
const L = i.useCallback(() => {
|
|
306
|
-
const g = m.current;
|
|
307
|
-
if (!g) return;
|
|
308
|
-
const { gl: r, uniforms: c } = g, p = h.current;
|
|
309
|
-
if (!p) return;
|
|
310
|
-
const s = Y.current, _ = N.current, x = 0.045;
|
|
311
|
-
s.speed = b(s.speed, _.speed, x), s.amplitude = b(s.amplitude, _.amplitude, x), s.glow = b(s.glow, _.glow, x), s.brightness = b(s.brightness, _.brightness, x), s.pulse = b(s.pulse, _.pulse, x), s.saturation = b(s.saturation, _.saturation, x);
|
|
312
|
-
const K = (performance.now() - W.current) / 1e3, T = window.devicePixelRatio || 1, j = p.getBoundingClientRect(), P = Math.round(j.width * T), k = Math.round(j.height * T);
|
|
313
|
-
(p.width !== P || p.height !== k) && (p.width = P, p.height = k), r.viewport(0, 0, P, k), r.clearColor(0, 0, 0, 0), r.clear(r.COLOR_BUFFER_BIT);
|
|
314
|
-
const z = C.current ? 0 : 1, V = w.current * z, D = B.current;
|
|
315
|
-
r.uniform1f(c.u_time, K), r.uniform1f(c.u_speed, (s.speed + V * 0.4) * z), r.uniform1f(c.u_amplitude, (s.amplitude + V * 0.12) * z), r.uniform1f(c.u_glow, s.glow + V * 0.2), r.uniform1f(c.u_brightness, s.brightness), r.uniform1f(c.u_pulse, s.pulse * z), r.uniform1f(c.u_saturation, s.saturation), r.uniform1f(c.u_seed, y.current), r.uniform1f(c.u_hue, A.current), r.uniform1f(c.u_radius, S.current), r.uniform3fv(c.u_color0, D[0]), r.uniform3fv(c.u_color1, D[1]), r.uniform3fv(c.u_color2, D[2]), r.uniform1f(c.u_dpr, T), r.drawArrays(r.TRIANGLE_STRIP, 0, 4), E.current = requestAnimationFrame(L);
|
|
316
|
-
}, []);
|
|
317
|
-
return i.useEffect(() => {
|
|
318
|
-
if (!I) return;
|
|
319
|
-
const g = h.current;
|
|
320
|
-
if (g && (m.current = re(g), !!m.current))
|
|
321
|
-
return E.current = requestAnimationFrame(L), () => {
|
|
322
|
-
cancelAnimationFrame(E.current);
|
|
323
|
-
const r = m.current;
|
|
324
|
-
if (r) {
|
|
325
|
-
const c = r.gl.getExtension("WEBGL_lose_context");
|
|
326
|
-
c == null || c.loseContext();
|
|
327
|
-
}
|
|
328
|
-
m.current = null;
|
|
329
|
-
};
|
|
330
|
-
}, [I, L]), /* @__PURE__ */ a("canvas", { ref: h, className: "size-full", "data-state": e });
|
|
331
|
-
}), se = i.forwardRef(
|
|
332
|
-
({
|
|
333
|
-
state: t = "idle",
|
|
334
|
-
variant: e = "orb",
|
|
335
|
-
className: n,
|
|
336
|
-
volume: u = 0,
|
|
337
|
-
palette: o = "default",
|
|
338
|
-
seed: l,
|
|
339
|
-
fill: f = !1,
|
|
340
|
-
onReady: d,
|
|
341
|
-
"aria-label": w,
|
|
342
|
-
...y
|
|
343
|
-
}, A) => {
|
|
344
|
-
const S = $() ?? !1, C = Math.min(1, Math.max(0, u)), h = i.useMemo(() => ie(l), [l]), m = o === "identity" ? h * Math.PI * 2 : 0;
|
|
345
|
-
return i.useEffect(() => {
|
|
346
|
-
d == null || d();
|
|
347
|
-
}, []), /* @__PURE__ */ a(
|
|
348
|
-
"div",
|
|
349
|
-
{
|
|
350
|
-
...y,
|
|
351
|
-
ref: A,
|
|
352
|
-
role: "img",
|
|
353
|
-
"aria-label": w ?? `AI voice, ${t}`,
|
|
354
|
-
"data-state": t,
|
|
355
|
-
"data-variant": e,
|
|
356
|
-
className: R(
|
|
357
|
-
"relative inline-flex size-24 shrink-0 items-center justify-center",
|
|
358
|
-
n
|
|
359
|
-
),
|
|
360
|
-
children: /* @__PURE__ */ a(
|
|
361
|
-
ce,
|
|
362
|
-
{
|
|
363
|
-
state: t,
|
|
364
|
-
palette: o,
|
|
365
|
-
volume: C,
|
|
366
|
-
reduced: S,
|
|
367
|
-
seed: h,
|
|
368
|
-
hue: m,
|
|
369
|
-
radius: f ? 0.98 : 0.44
|
|
370
|
-
}
|
|
371
|
-
)
|
|
372
|
-
}
|
|
373
|
-
);
|
|
374
|
-
}
|
|
375
|
-
);
|
|
376
|
-
se.displayName = "Voice";
|
|
377
|
-
const ae = {
|
|
378
|
-
idle: "bg-muted-foreground",
|
|
379
|
-
connecting: "bg-warning motion-safe:animate-pulse",
|
|
380
|
-
listening: "bg-success",
|
|
381
|
-
thinking: "bg-warning motion-safe:animate-pulse",
|
|
382
|
-
speaking: "bg-success",
|
|
383
|
-
muted: "bg-danger",
|
|
384
|
-
asleep: "bg-muted-foreground opacity-50"
|
|
385
|
-
};
|
|
386
|
-
function ue({ state: t = "idle", className: e }) {
|
|
387
|
-
return /* @__PURE__ */ a(
|
|
388
|
-
"span",
|
|
389
|
-
{
|
|
390
|
-
"aria-hidden": !0,
|
|
391
|
-
className: R(
|
|
392
|
-
"inline-block size-2.5 shrink-0 rounded-dot transition-[background-color,opacity] duration-200 ease-out motion-reduce:transition-none",
|
|
393
|
-
ae[t],
|
|
394
|
-
e
|
|
395
|
-
)
|
|
396
|
-
}
|
|
397
|
-
);
|
|
398
|
-
}
|
|
399
|
-
function le({
|
|
400
|
-
onConnect: t,
|
|
401
|
-
disabled: e,
|
|
402
|
-
className: n
|
|
403
|
-
}) {
|
|
404
|
-
return /* @__PURE__ */ a(
|
|
405
|
-
U,
|
|
406
|
-
{
|
|
407
|
-
variant: "ghost",
|
|
408
|
-
size: "sm",
|
|
409
|
-
disabled: e,
|
|
410
|
-
onClick: t,
|
|
411
|
-
startContent: /* @__PURE__ */ a(J, {}),
|
|
412
|
-
className: R(
|
|
413
|
-
"bg-success-50 text-success-700 hover:bg-success-100 hover:text-success-700",
|
|
414
|
-
n
|
|
415
|
-
),
|
|
416
|
-
children: "Connect"
|
|
417
|
-
}
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
function fe({
|
|
421
|
-
isMuted: t = !1,
|
|
422
|
-
onMute: e,
|
|
423
|
-
onUnmute: n,
|
|
424
|
-
disabled: u,
|
|
425
|
-
className: o
|
|
426
|
-
}) {
|
|
427
|
-
return /* @__PURE__ */ a(H, { content: t ? "Unmute" : "Mute", children: /* @__PURE__ */ a(
|
|
428
|
-
U,
|
|
429
|
-
{
|
|
430
|
-
variant: "ghost",
|
|
431
|
-
size: "icon-sm",
|
|
432
|
-
disabled: u,
|
|
433
|
-
"aria-label": t ? "Unmute" : "Mute",
|
|
434
|
-
onClick: () => t ? n == null ? void 0 : n() : e == null ? void 0 : e(),
|
|
435
|
-
className: R(
|
|
436
|
-
t ? "bg-warning-50 text-warning-700 hover:bg-warning-100 hover:text-warning-700" : "bg-info-50 text-info-700 hover:bg-info-100 hover:text-info-700",
|
|
437
|
-
o
|
|
438
|
-
),
|
|
439
|
-
children: t ? /* @__PURE__ */ a(Z, {}) : /* @__PURE__ */ a(ee, {})
|
|
440
|
-
}
|
|
441
|
-
) });
|
|
442
|
-
}
|
|
443
|
-
function de({
|
|
444
|
-
onDisconnect: t,
|
|
445
|
-
disabled: e,
|
|
446
|
-
className: n
|
|
447
|
-
}) {
|
|
448
|
-
return /* @__PURE__ */ a(H, { content: "Disconnect", children: /* @__PURE__ */ a(
|
|
449
|
-
U,
|
|
450
|
-
{
|
|
451
|
-
variant: "ghost",
|
|
452
|
-
size: "icon-sm",
|
|
453
|
-
disabled: e,
|
|
454
|
-
"aria-label": "Disconnect",
|
|
455
|
-
onClick: t,
|
|
456
|
-
className: R(
|
|
457
|
-
"bg-danger-50 text-danger-700 hover:bg-danger-100 hover:text-danger-700",
|
|
458
|
-
n
|
|
459
|
-
),
|
|
460
|
-
children: /* @__PURE__ */ a(Q, {})
|
|
461
|
-
}
|
|
462
|
-
) });
|
|
463
|
-
}
|
|
464
|
-
function me(t, e) {
|
|
465
|
-
return t === "ended" ? "idle" : t === "starting" ? "connecting" : e ? "muted" : "listening";
|
|
466
|
-
}
|
|
467
|
-
function ye({
|
|
468
|
-
status: t,
|
|
469
|
-
isMuted: e = !1,
|
|
470
|
-
onConnect: n,
|
|
471
|
-
onMute: u,
|
|
472
|
-
onUnmute: o,
|
|
473
|
-
onDisconnect: l,
|
|
474
|
-
className: f
|
|
475
|
-
}) {
|
|
476
|
-
return /* @__PURE__ */ G("div", { className: R("flex items-center gap-2", f), children: [
|
|
477
|
-
/* @__PURE__ */ a(ue, { state: me(t, e) }),
|
|
478
|
-
t === "ended" && /* @__PURE__ */ a(le, { onConnect: n }),
|
|
479
|
-
t === "starting" && /* @__PURE__ */ a("span", { className: "text-base text-secondary", children: "Connecting…" }),
|
|
480
|
-
t === "running" && /* @__PURE__ */ G(X, { children: [
|
|
481
|
-
/* @__PURE__ */ a(fe, { isMuted: e, onMute: u, onUnmute: o }),
|
|
482
|
-
/* @__PURE__ */ a(de, { onDisconnect: l })
|
|
483
|
-
] })
|
|
484
|
-
] });
|
|
485
|
-
}
|
|
486
|
-
export {
|
|
487
|
-
be as VOICE_PALETTES,
|
|
488
|
-
we as VOICE_STATES,
|
|
489
|
-
Re as VOICE_VARIANTS,
|
|
490
|
-
se as Voice,
|
|
491
|
-
le as VoiceConnectButton,
|
|
492
|
-
ye as VoiceControl,
|
|
493
|
-
de as VoiceDisconnectButton,
|
|
494
|
-
fe as VoiceMuteButton,
|
|
495
|
-
ue as VoiceStatusDot
|
|
496
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '../button';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export interface FollowUpSuggestionProps extends Omit<ButtonProps, "size" | "variant"> {
|
|
4
|
-
}
|
|
5
|
-
/** Compact runtime suggestion shown above the composer. */
|
|
6
|
-
export declare const FollowUpSuggestion: React.ForwardRefExoticComponent<FollowUpSuggestionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
export interface FollowUpQuestionProps extends Omit<ButtonProps, "size" | "variant" | "startContent" | "endContent"> {
|
|
8
|
-
}
|
|
9
|
-
/** Full-width next-question row used at the end of a structured answer. */
|
|
10
|
-
export declare const FollowUpQuestion: React.ForwardRefExoticComponent<FollowUpQuestionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
-
export declare const ThreadFollowupSuggestions: React.FC;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
3
|
-
import * as i from "react";
|
|
4
|
-
import { useAuiState as d, AuiIf as p, ThreadPrimitive as m } from "@assistant-ui/react";
|
|
5
|
-
import { Button as n } from "../button.js";
|
|
6
|
-
import { AgentChat as g, ArrowUpRight as c } from "../../lib/icons.js";
|
|
7
|
-
import { cn as s } from "../../lib/cn.js";
|
|
8
|
-
const a = i.forwardRef(({ className: o, ...e }, r) => /* @__PURE__ */ t(
|
|
9
|
-
n,
|
|
10
|
-
{
|
|
11
|
-
ref: r,
|
|
12
|
-
size: "xs",
|
|
13
|
-
variant: "outline",
|
|
14
|
-
className: s(
|
|
15
|
-
"aui-thread-followup-suggestion rounded-full border-border/60 bg-background px-3 font-normal hover:bg-muted/80",
|
|
16
|
-
o
|
|
17
|
-
),
|
|
18
|
-
...e
|
|
19
|
-
}
|
|
20
|
-
));
|
|
21
|
-
a.displayName = "FollowUpSuggestion";
|
|
22
|
-
const h = i.forwardRef(({ className: o, children: e, ...r }, l) => /* @__PURE__ */ u(
|
|
23
|
-
n,
|
|
24
|
-
{
|
|
25
|
-
ref: l,
|
|
26
|
-
size: "sm",
|
|
27
|
-
variant: "outline",
|
|
28
|
-
className: s(
|
|
29
|
-
"group/followup h-auto w-full justify-start whitespace-normal rounded-lg border-border bg-card px-3.5 py-2.5 text-left text-sm text-foreground hover:bg-surface",
|
|
30
|
-
"motion-reduce:transition-none [&>span]:w-full [&>span]:gap-2.5",
|
|
31
|
-
o
|
|
32
|
-
),
|
|
33
|
-
...r,
|
|
34
|
-
children: [
|
|
35
|
-
/* @__PURE__ */ t(g, { "aria-hidden": !0, className: "size-4 shrink-0 text-tertiary" }),
|
|
36
|
-
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: e }),
|
|
37
|
-
/* @__PURE__ */ t(
|
|
38
|
-
c,
|
|
39
|
-
{
|
|
40
|
-
"aria-hidden": !0,
|
|
41
|
-
className: "size-4 shrink-0 text-tertiary transition-colors group-hover/followup:text-foreground motion-reduce:transition-none"
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
));
|
|
47
|
-
h.displayName = "FollowUpQuestion";
|
|
48
|
-
const N = () => {
|
|
49
|
-
const o = d((e) => e.thread.suggestions);
|
|
50
|
-
return /* @__PURE__ */ t(
|
|
51
|
-
p,
|
|
52
|
-
{
|
|
53
|
-
condition: (e) => !e.thread.isEmpty && !e.thread.isRunning && e.thread.suggestions.length > 0,
|
|
54
|
-
children: /* @__PURE__ */ t("div", { className: "aui-thread-followup-suggestions flex min-h-8 items-center justify-center gap-2", children: o.map((e, r) => /* @__PURE__ */ t(
|
|
55
|
-
m.Suggestion,
|
|
56
|
-
{
|
|
57
|
-
prompt: e.prompt,
|
|
58
|
-
method: "replace",
|
|
59
|
-
autoSend: !0,
|
|
60
|
-
asChild: !0,
|
|
61
|
-
children: /* @__PURE__ */ t(a, { children: e.prompt })
|
|
62
|
-
},
|
|
63
|
-
r
|
|
64
|
-
)) })
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
export {
|
|
69
|
-
h as FollowUpQuestion,
|
|
70
|
-
a as FollowUpSuggestion,
|
|
71
|
-
N as ThreadFollowupSuggestions
|
|
72
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Welcome-screen suggestion chips. Renders the thread's configured
|
|
4
|
-
* suggestions (`ThreadPrimitive.Suggestions`); each chip sends on click.
|
|
5
|
-
*/
|
|
6
|
-
export declare const ThreadSuggestions: FC;
|
|
7
|
-
export declare const ThreadSuggestionItem: FC;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
3
|
-
import { Button as r } from "../ui/button.js";
|
|
4
|
-
import { SuggestionPrimitive as t, ThreadPrimitive as o } from "@assistant-ui/react";
|
|
5
|
-
const l = () => /* @__PURE__ */ e("div", { className: "aui-thread-welcome-suggestions flex w-full flex-wrap items-center justify-center gap-2 px-4", children: /* @__PURE__ */ e(o.Suggestions, { children: () => /* @__PURE__ */ e(s, {}) }) }), s = () => /* @__PURE__ */ e("div", { className: "aui-thread-welcome-suggestion-display fade-in slide-in-from-bottom-2 animate-in fill-mode-both duration-200", children: /* @__PURE__ */ e(t.Trigger, { send: !0, asChild: !0, children: /* @__PURE__ */ i(
|
|
6
|
-
r,
|
|
7
|
-
{
|
|
8
|
-
variant: "ghost",
|
|
9
|
-
className: "aui-thread-welcome-suggestion text-foreground hover:bg-muted border-border/60 h-auto gap-1.5 rounded-full border px-3.5 py-1.5 text-xs font-normal whitespace-nowrap transition-colors",
|
|
10
|
-
children: [
|
|
11
|
-
/* @__PURE__ */ e(t.Title, { className: "aui-thread-welcome-suggestion-text-1" }),
|
|
12
|
-
/* @__PURE__ */ e(t.Description, { className: "aui-thread-welcome-suggestion-text-2 empty:hidden" })
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
) }) });
|
|
16
|
-
export {
|
|
17
|
-
s as ThreadSuggestionItem,
|
|
18
|
-
l as ThreadSuggestions
|
|
19
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useVoiceState } from '@assistant-ui/react';
|
|
2
|
-
import { FC } from 'react';
|
|
3
|
-
export type VoiceOrbState = "idle" | "connecting" | "listening" | "speaking" | "muted";
|
|
4
|
-
export type VoiceOrbVariant = "default" | "blue" | "violet" | "emerald";
|
|
5
|
-
export type VoiceOrbProps = {
|
|
6
|
-
state?: VoiceOrbState;
|
|
7
|
-
variant?: VoiceOrbVariant;
|
|
8
|
-
className?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function deriveVoiceOrbState(voiceState: ReturnType<typeof useVoiceState>): VoiceOrbState;
|
|
11
|
-
export declare const VoiceOrb: FC<VoiceOrbProps>;
|
|
12
|
-
export declare const VoiceControl: FC<{
|
|
13
|
-
className?: string;
|
|
14
|
-
}>;
|
|
15
|
-
export declare const VoiceStatusDot: FC;
|
|
16
|
-
export declare const VoiceConnectButton: FC;
|
|
17
|
-
export declare const VoiceMuteButton: FC;
|
|
18
|
-
export declare const VoiceDisconnectButton: FC;
|
package/components/link.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
declare const colorClasses: {
|
|
3
|
-
readonly default: "text-foreground";
|
|
4
|
-
readonly muted: "text-muted-foreground";
|
|
5
|
-
readonly primary: "text-brand";
|
|
6
|
-
};
|
|
7
|
-
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
8
|
-
color?: keyof typeof colorClasses;
|
|
9
|
-
/** Opens in a new tab with safe rel; a ↗ arrow fades in on hover to signal
|
|
10
|
-
* the link leaves the app. */
|
|
11
|
-
isExternal?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
14
|
-
export {};
|