@epicbagel/saas-kit 1.22.0 → 1.23.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/dist/chunk-HETZNLKT.cjs +148 -0
- package/dist/chunk-PL2462GA.js +148 -0
- package/dist/primitives/agent-audio-visualizer-bar.d.cts +2 -2
- package/dist/primitives/agent-audio-visualizer-bar.d.ts +2 -2
- package/dist/primitives/alert.d.cts +1 -1
- package/dist/primitives/alert.d.ts +1 -1
- package/dist/primitives/attachment.d.cts +1 -1
- package/dist/primitives/attachment.d.ts +1 -1
- package/dist/primitives/badge.d.cts +1 -1
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/bubble.d.cts +1 -1
- package/dist/primitives/bubble.d.ts +1 -1
- package/dist/primitives/button.d.cts +2 -2
- package/dist/primitives/button.d.ts +2 -2
- package/dist/primitives/chat.cjs +4 -4
- package/dist/primitives/chat.js +1 -1
- package/dist/primitives/item.d.cts +2 -2
- package/dist/primitives/item.d.ts +2 -2
- package/dist/primitives/section-header.d.cts +1 -1
- package/dist/primitives/section-header.d.ts +1 -1
- package/dist/primitives/toggle-group.d.cts +2 -2
- package/dist/primitives/toggle-group.d.ts +2 -2
- package/dist/primitives/toggle.d.cts +2 -2
- package/dist/primitives/toggle.d.ts +2 -2
- package/dist/primitives/voice-session-controls.cjs +2 -2
- package/dist/primitives/voice-session-controls.d.cts +9 -1
- package/dist/primitives/voice-session-controls.d.ts +9 -1
- package/dist/primitives/voice-session-controls.js +1 -1
- package/dist/primitives/workflow-assistant.cjs +2 -2
- package/dist/primitives/workflow-assistant.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KF4X37DP.js +0 -140
- package/dist/chunk-YMI3X2YL.cjs +0 -140
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkNKWHDI4Ccjs = require('./chunk-NKWHDI4C.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkJDEXZGIYcjs = require('./chunk-JDEXZGIY.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkKWLSBTB2cjs = require('./chunk-KWLSBTB2.cjs');
|
|
11
|
+
|
|
12
|
+
// src/primitives/voice-session-controls.tsx
|
|
13
|
+
var _react = require('react');
|
|
14
|
+
var _lucidereact = require('lucide-react');
|
|
15
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
16
|
+
var SILENCE = [];
|
|
17
|
+
var silence = () => SILENCE;
|
|
18
|
+
var noSubscription = () => () => {
|
|
19
|
+
};
|
|
20
|
+
var DEFAULT_LABELS = {
|
|
21
|
+
disconnected: "Voice chat",
|
|
22
|
+
connecting: "Connecting\u2026",
|
|
23
|
+
listening: "Listening\u2026",
|
|
24
|
+
thinking: "Thinking\u2026",
|
|
25
|
+
speaking: "Speaking",
|
|
26
|
+
reconnecting: "Reconnecting\u2026",
|
|
27
|
+
error: "Voice chat unavailable",
|
|
28
|
+
start: "Start voice chat",
|
|
29
|
+
end: "End voice chat",
|
|
30
|
+
mute: "Mute microphone",
|
|
31
|
+
unmute: "Unmute microphone",
|
|
32
|
+
muted: "Microphone muted",
|
|
33
|
+
retry: "Retry voice chat",
|
|
34
|
+
endShort: "End voice",
|
|
35
|
+
muteShort: "Mute",
|
|
36
|
+
unmuteShort: "Unmute"
|
|
37
|
+
};
|
|
38
|
+
function VoiceSessionControls({
|
|
39
|
+
state,
|
|
40
|
+
onStart,
|
|
41
|
+
onEnd,
|
|
42
|
+
muted = false,
|
|
43
|
+
onMutedChange,
|
|
44
|
+
disabled = false,
|
|
45
|
+
error,
|
|
46
|
+
volumeBands,
|
|
47
|
+
audioLevels,
|
|
48
|
+
labels,
|
|
49
|
+
onWarm,
|
|
50
|
+
size = "icon",
|
|
51
|
+
className
|
|
52
|
+
}) {
|
|
53
|
+
const liveBands = _react.useSyncExternalStore.call(void 0, _nullishCoalesce(_optionalChain([audioLevels, 'optionalAccess', _ => _.subscribe]), () => ( noSubscription)), _nullishCoalesce(_optionalChain([audioLevels, 'optionalAccess', _2 => _2.getSnapshot]), () => ( silence)), silence);
|
|
54
|
+
const copy = { ...DEFAULT_LABELS, ...labels };
|
|
55
|
+
const active = state !== "disconnected" && state !== "error";
|
|
56
|
+
const waiting = state === "connecting" || state === "reconnecting";
|
|
57
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "voice-session-controls",
|
|
61
|
+
"data-state": state,
|
|
62
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0, "min-w-0", active ? "@container/voice w-full" : "flex flex-wrap items-center gap-2", className),
|
|
63
|
+
children: [
|
|
64
|
+
active ? (
|
|
65
|
+
// One row at every width: on a narrow strip the actions show only their
|
|
66
|
+
// icons (each keeps its full name), rather than wrapping onto a second row.
|
|
67
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-slot": "voice-session-strip", className: "flex w-full flex-nowrap items-center gap-3 bg-primary/5 p-3 @sm/voice:gap-4 @sm/voice:p-4 @2xl/voice:px-5", children: [
|
|
68
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-1 items-center gap-3 @2xl/voice:gap-4", children: [
|
|
69
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "aria-hidden": "true", className: _chunkKWLSBTB2cjs.cn.call(void 0,
|
|
70
|
+
"flex size-10 shrink-0 items-center justify-center rounded-full ring-8 ring-primary/5 @sm/voice:size-12 @md/voice:size-14",
|
|
71
|
+
muted ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground"
|
|
72
|
+
), children: muted ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MicOff, { className: "size-5" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Mic, { className: "size-5" }) }),
|
|
73
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
74
|
+
_chunkNKWHDI4Ccjs.AgentAudioVisualizerBar,
|
|
75
|
+
{
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
size: "sm",
|
|
78
|
+
barCount: 5,
|
|
79
|
+
className: "shrink-0 text-primary [&>div]:w-1",
|
|
80
|
+
state: muted && state === "listening" ? "disconnected" : state === "reconnecting" ? "connecting" : state,
|
|
81
|
+
volumeBands: muted && state === "listening" ? SILENCE : _nullishCoalesce(volumeBands, () => ( liveBands))
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "status", className: "min-w-0 flex-1 truncate text-sm font-medium text-primary", children: muted && state === "listening" ? copy.muted : copy[state] })
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
87
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
88
|
+
_chunkJDEXZGIYcjs.Button,
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
variant: "outline",
|
|
92
|
+
size: "sm",
|
|
93
|
+
className: "min-h-[44px] min-w-[44px] shrink-0 rounded-xl bg-background px-0 text-foreground @md/voice:px-3",
|
|
94
|
+
"aria-label": muted ? copy.unmute : copy.mute,
|
|
95
|
+
title: muted ? copy.unmute : copy.mute,
|
|
96
|
+
"aria-pressed": muted,
|
|
97
|
+
disabled: waiting,
|
|
98
|
+
onClick: () => onMutedChange(!muted),
|
|
99
|
+
children: [
|
|
100
|
+
muted ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Mic, { "aria-hidden": "true" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MicOff, { "aria-hidden": "true" }),
|
|
101
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-slot": "voice-session-action-label", className: "hidden @md/voice:inline", children: muted ? copy.unmuteShort : copy.muteShort })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
106
|
+
_chunkJDEXZGIYcjs.Button,
|
|
107
|
+
{
|
|
108
|
+
type: "button",
|
|
109
|
+
variant: "outline",
|
|
110
|
+
size: "sm",
|
|
111
|
+
className: "min-h-[44px] min-w-[44px] shrink-0 rounded-xl bg-background px-0 text-foreground @md/voice:px-3",
|
|
112
|
+
"aria-label": copy.end,
|
|
113
|
+
title: copy.end,
|
|
114
|
+
onClick: onEnd,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Square, { "aria-hidden": "true", className: "fill-current" }),
|
|
117
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-slot": "voice-session-action-label", className: "hidden @md/voice:inline", children: copy.endShort })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] })
|
|
122
|
+
] })
|
|
123
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
124
|
+
_chunkJDEXZGIYcjs.Button,
|
|
125
|
+
{
|
|
126
|
+
type: "button",
|
|
127
|
+
size: "icon",
|
|
128
|
+
shape: "circle",
|
|
129
|
+
disabled,
|
|
130
|
+
onClick: onStart,
|
|
131
|
+
onPointerEnter: onWarm,
|
|
132
|
+
onPointerDown: onWarm,
|
|
133
|
+
onFocus: onWarm,
|
|
134
|
+
"aria-label": state === "error" ? copy.retry : copy.start,
|
|
135
|
+
title: state === "error" ? copy.retry : copy.start,
|
|
136
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0, "min-h-[44px] min-w-[44px] shrink-0 rounded-full", size === "hero" && "size-24 [&_svg]:size-7"),
|
|
137
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AudioLines, { "aria-hidden": "true" })
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
state === "error" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "alert", className: "basis-full text-xs text-destructive", children: error || copy.error })
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
exports.VoiceSessionControls = VoiceSessionControls;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
AgentAudioVisualizerBar
|
|
4
|
+
} from "./chunk-5OF6D3GH.js";
|
|
5
|
+
import {
|
|
6
|
+
Button
|
|
7
|
+
} from "./chunk-W326GKML.js";
|
|
8
|
+
import {
|
|
9
|
+
cn
|
|
10
|
+
} from "./chunk-G6SRSWXB.js";
|
|
11
|
+
|
|
12
|
+
// src/primitives/voice-session-controls.tsx
|
|
13
|
+
import { useSyncExternalStore } from "react";
|
|
14
|
+
import { Mic, MicOff, Square, AudioLines } from "lucide-react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var SILENCE = [];
|
|
17
|
+
var silence = () => SILENCE;
|
|
18
|
+
var noSubscription = () => () => {
|
|
19
|
+
};
|
|
20
|
+
var DEFAULT_LABELS = {
|
|
21
|
+
disconnected: "Voice chat",
|
|
22
|
+
connecting: "Connecting\u2026",
|
|
23
|
+
listening: "Listening\u2026",
|
|
24
|
+
thinking: "Thinking\u2026",
|
|
25
|
+
speaking: "Speaking",
|
|
26
|
+
reconnecting: "Reconnecting\u2026",
|
|
27
|
+
error: "Voice chat unavailable",
|
|
28
|
+
start: "Start voice chat",
|
|
29
|
+
end: "End voice chat",
|
|
30
|
+
mute: "Mute microphone",
|
|
31
|
+
unmute: "Unmute microphone",
|
|
32
|
+
muted: "Microphone muted",
|
|
33
|
+
retry: "Retry voice chat",
|
|
34
|
+
endShort: "End voice",
|
|
35
|
+
muteShort: "Mute",
|
|
36
|
+
unmuteShort: "Unmute"
|
|
37
|
+
};
|
|
38
|
+
function VoiceSessionControls({
|
|
39
|
+
state,
|
|
40
|
+
onStart,
|
|
41
|
+
onEnd,
|
|
42
|
+
muted = false,
|
|
43
|
+
onMutedChange,
|
|
44
|
+
disabled = false,
|
|
45
|
+
error,
|
|
46
|
+
volumeBands,
|
|
47
|
+
audioLevels,
|
|
48
|
+
labels,
|
|
49
|
+
onWarm,
|
|
50
|
+
size = "icon",
|
|
51
|
+
className
|
|
52
|
+
}) {
|
|
53
|
+
const liveBands = useSyncExternalStore(audioLevels?.subscribe ?? noSubscription, audioLevels?.getSnapshot ?? silence, silence);
|
|
54
|
+
const copy = { ...DEFAULT_LABELS, ...labels };
|
|
55
|
+
const active = state !== "disconnected" && state !== "error";
|
|
56
|
+
const waiting = state === "connecting" || state === "reconnecting";
|
|
57
|
+
return /* @__PURE__ */ jsxs(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "voice-session-controls",
|
|
61
|
+
"data-state": state,
|
|
62
|
+
className: cn("min-w-0", active ? "@container/voice w-full" : "flex flex-wrap items-center gap-2", className),
|
|
63
|
+
children: [
|
|
64
|
+
active ? (
|
|
65
|
+
// One row at every width: on a narrow strip the actions show only their
|
|
66
|
+
// icons (each keeps its full name), rather than wrapping onto a second row.
|
|
67
|
+
/* @__PURE__ */ jsxs("div", { "data-slot": "voice-session-strip", className: "flex w-full flex-nowrap items-center gap-3 bg-primary/5 p-3 @sm/voice:gap-4 @sm/voice:p-4 @2xl/voice:px-5", children: [
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3 @2xl/voice:gap-4", children: [
|
|
69
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: cn(
|
|
70
|
+
"flex size-10 shrink-0 items-center justify-center rounded-full ring-8 ring-primary/5 @sm/voice:size-12 @md/voice:size-14",
|
|
71
|
+
muted ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground"
|
|
72
|
+
), children: muted ? /* @__PURE__ */ jsx(MicOff, { className: "size-5" }) : /* @__PURE__ */ jsx(Mic, { className: "size-5" }) }),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
AgentAudioVisualizerBar,
|
|
75
|
+
{
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
size: "sm",
|
|
78
|
+
barCount: 5,
|
|
79
|
+
className: "shrink-0 text-primary [&>div]:w-1",
|
|
80
|
+
state: muted && state === "listening" ? "disconnected" : state === "reconnecting" ? "connecting" : state,
|
|
81
|
+
volumeBands: muted && state === "listening" ? SILENCE : volumeBands ?? liveBands
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ jsx("span", { role: "status", className: "min-w-0 flex-1 truncate text-sm font-medium text-primary", children: muted && state === "listening" ? copy.muted : copy[state] })
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
87
|
+
/* @__PURE__ */ jsxs(
|
|
88
|
+
Button,
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
variant: "outline",
|
|
92
|
+
size: "sm",
|
|
93
|
+
className: "min-h-[44px] min-w-[44px] shrink-0 rounded-xl bg-background px-0 text-foreground @md/voice:px-3",
|
|
94
|
+
"aria-label": muted ? copy.unmute : copy.mute,
|
|
95
|
+
title: muted ? copy.unmute : copy.mute,
|
|
96
|
+
"aria-pressed": muted,
|
|
97
|
+
disabled: waiting,
|
|
98
|
+
onClick: () => onMutedChange(!muted),
|
|
99
|
+
children: [
|
|
100
|
+
muted ? /* @__PURE__ */ jsx(Mic, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(MicOff, { "aria-hidden": "true" }),
|
|
101
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "voice-session-action-label", className: "hidden @md/voice:inline", children: muted ? copy.unmuteShort : copy.muteShort })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ jsxs(
|
|
106
|
+
Button,
|
|
107
|
+
{
|
|
108
|
+
type: "button",
|
|
109
|
+
variant: "outline",
|
|
110
|
+
size: "sm",
|
|
111
|
+
className: "min-h-[44px] min-w-[44px] shrink-0 rounded-xl bg-background px-0 text-foreground @md/voice:px-3",
|
|
112
|
+
"aria-label": copy.end,
|
|
113
|
+
title: copy.end,
|
|
114
|
+
onClick: onEnd,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Square, { "aria-hidden": "true", className: "fill-current" }),
|
|
117
|
+
/* @__PURE__ */ jsx("span", { "data-slot": "voice-session-action-label", className: "hidden @md/voice:inline", children: copy.endShort })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] })
|
|
122
|
+
] })
|
|
123
|
+
) : /* @__PURE__ */ jsx(
|
|
124
|
+
Button,
|
|
125
|
+
{
|
|
126
|
+
type: "button",
|
|
127
|
+
size: "icon",
|
|
128
|
+
shape: "circle",
|
|
129
|
+
disabled,
|
|
130
|
+
onClick: onStart,
|
|
131
|
+
onPointerEnter: onWarm,
|
|
132
|
+
onPointerDown: onWarm,
|
|
133
|
+
onFocus: onWarm,
|
|
134
|
+
"aria-label": state === "error" ? copy.retry : copy.start,
|
|
135
|
+
title: state === "error" ? copy.retry : copy.start,
|
|
136
|
+
className: cn("min-h-[44px] min-w-[44px] shrink-0 rounded-full", size === "hero" && "size-24 [&_svg]:size-7"),
|
|
137
|
+
children: /* @__PURE__ */ jsx(AudioLines, { "aria-hidden": "true" })
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
state === "error" && /* @__PURE__ */ jsx("span", { role: "alert", className: "basis-full text-xs text-destructive", children: error || copy.error })
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
VoiceSessionControls
|
|
148
|
+
};
|
|
@@ -11,10 +11,10 @@ import { AgentVisualizerState } from '../hooks/use-agent-audio-visualizer-bar.cj
|
|
|
11
11
|
*/
|
|
12
12
|
declare function normalizeVolumeBands(bands: number[], count: number): number[];
|
|
13
13
|
declare const AgentAudioVisualizerBarElementVariants: (props?: ({
|
|
14
|
-
size?: "
|
|
14
|
+
size?: "sm" | "md" | "lg" | "xl" | "icon" | null | undefined;
|
|
15
15
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
16
16
|
declare const AgentAudioVisualizerBarVariants: (props?: ({
|
|
17
|
-
size?: "
|
|
17
|
+
size?: "sm" | "md" | "lg" | "xl" | "icon" | null | undefined;
|
|
18
18
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
19
19
|
/**
|
|
20
20
|
* Props for the AgentAudioVisualizerBar component.
|
|
@@ -11,10 +11,10 @@ import { AgentVisualizerState } from '../hooks/use-agent-audio-visualizer-bar.js
|
|
|
11
11
|
*/
|
|
12
12
|
declare function normalizeVolumeBands(bands: number[], count: number): number[];
|
|
13
13
|
declare const AgentAudioVisualizerBarElementVariants: (props?: ({
|
|
14
|
-
size?: "
|
|
14
|
+
size?: "sm" | "md" | "lg" | "xl" | "icon" | null | undefined;
|
|
15
15
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
16
16
|
declare const AgentAudioVisualizerBarVariants: (props?: ({
|
|
17
|
-
size?: "
|
|
17
|
+
size?: "sm" | "md" | "lg" | "xl" | "icon" | null | undefined;
|
|
18
18
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
19
19
|
/**
|
|
20
20
|
* Props for the AgentAudioVisualizerBar component.
|
|
@@ -4,7 +4,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const alertVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface AlertProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
10
10
|
marginBottom?: "none" | "md";
|
|
@@ -4,7 +4,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const alertVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface AlertProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
10
10
|
marginBottom?: "none" | "md";
|
|
@@ -12,7 +12,7 @@ declare function Attachment({ className, state, size, orientation, ...props }: R
|
|
|
12
12
|
state?: "idle" | "uploading" | "processing" | "error" | "done";
|
|
13
13
|
}): react_jsx_runtime.JSX.Element;
|
|
14
14
|
declare const attachmentMediaVariants: (props?: ({
|
|
15
|
-
variant?: "
|
|
15
|
+
variant?: "image" | "icon" | null | undefined;
|
|
16
16
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
17
|
declare function AttachmentMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>): react_jsx_runtime.JSX.Element;
|
|
18
18
|
declare function AttachmentContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
@@ -12,7 +12,7 @@ declare function Attachment({ className, state, size, orientation, ...props }: R
|
|
|
12
12
|
state?: "idle" | "uploading" | "processing" | "error" | "done";
|
|
13
13
|
}): react_jsx_runtime.JSX.Element;
|
|
14
14
|
declare const attachmentMediaVariants: (props?: ({
|
|
15
|
-
variant?: "
|
|
15
|
+
variant?: "image" | "icon" | null | undefined;
|
|
16
16
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
17
|
declare function AttachmentMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>): react_jsx_runtime.JSX.Element;
|
|
18
18
|
declare function AttachmentContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { ElementType } from 'react';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "success" | "warning" | "error" | "info" | "neutral" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
10
10
|
weight?: "normal" | "semibold" | "bold";
|
|
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { ElementType } from 'react';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "success" | "warning" | "error" | "info" | "neutral" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
10
10
|
weight?: "normal" | "semibold" | "bold";
|
|
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
7
7
|
declare const bubbleVariants: (props?: ({
|
|
8
|
-
variant?: "
|
|
8
|
+
variant?: "default" | "muted" | "secondary" | "destructive" | "outline" | "ghost" | "tinted" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
|
|
11
11
|
align?: "start" | "end";
|
|
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
7
7
|
declare const bubbleVariants: (props?: ({
|
|
8
|
-
variant?: "
|
|
8
|
+
variant?: "default" | "muted" | "secondary" | "destructive" | "outline" | "ghost" | "tinted" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
|
|
11
11
|
align?: "start" | "end";
|
|
@@ -5,12 +5,12 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
7
|
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "outline-muted" | "ghost" | "quiet" | "ghost-destructive" | "link-muted" | "inverted" | "status-error" | "status-warning" | "status-muted" | null | undefined;
|
|
8
|
-
size?: "filter" | "status" | "
|
|
8
|
+
size?: "filter" | "status" | "toolbar" | "sm" | "lg" | "default" | "micro" | "compact" | "hero" | "icon" | "icon-lg" | "icon-sm" | "icon-md" | "icon-xs" | "icon-compact" | "icon-micro" | "bare" | "voice-sm" | "voice" | "suggestion" | "tone" | null | undefined;
|
|
9
9
|
width?: "auto" | "full" | "responsive" | null | undefined;
|
|
10
10
|
align?: "center" | "start" | null | undefined;
|
|
11
11
|
shrink?: boolean | null | undefined;
|
|
12
12
|
shape?: "circle" | "default" | "pill" | null | undefined;
|
|
13
|
-
ring?: "
|
|
13
|
+
ring?: "none" | "surface" | null | undefined;
|
|
14
14
|
grow?: boolean | null | undefined;
|
|
15
15
|
minWidth?: "auto" | "zero" | null | undefined;
|
|
16
16
|
textAlign?: "center" | "start" | null | undefined;
|
|
@@ -5,12 +5,12 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
7
|
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "outline-muted" | "ghost" | "quiet" | "ghost-destructive" | "link-muted" | "inverted" | "status-error" | "status-warning" | "status-muted" | null | undefined;
|
|
8
|
-
size?: "filter" | "status" | "
|
|
8
|
+
size?: "filter" | "status" | "toolbar" | "sm" | "lg" | "default" | "micro" | "compact" | "hero" | "icon" | "icon-lg" | "icon-sm" | "icon-md" | "icon-xs" | "icon-compact" | "icon-micro" | "bare" | "voice-sm" | "voice" | "suggestion" | "tone" | null | undefined;
|
|
9
9
|
width?: "auto" | "full" | "responsive" | null | undefined;
|
|
10
10
|
align?: "center" | "start" | null | undefined;
|
|
11
11
|
shrink?: boolean | null | undefined;
|
|
12
12
|
shape?: "circle" | "default" | "pill" | null | undefined;
|
|
13
|
-
ring?: "
|
|
13
|
+
ring?: "none" | "surface" | null | undefined;
|
|
14
14
|
grow?: boolean | null | undefined;
|
|
15
15
|
minWidth?: "auto" | "zero" | null | undefined;
|
|
16
16
|
textAlign?: "center" | "start" | null | undefined;
|
package/dist/primitives/chat.cjs
CHANGED
|
@@ -10,7 +10,7 @@ var _chunk2BTDBZYNcjs = require('../chunk-2BTDBZYN.cjs');
|
|
|
10
10
|
var _chunkPH2TV7XIcjs = require('../chunk-PH2TV7XI.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkHETZNLKTcjs = require('../chunk-HETZNLKT.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -489,7 +489,7 @@ function ChatInput({
|
|
|
489
489
|
children: header
|
|
490
490
|
}
|
|
491
491
|
),
|
|
492
|
-
liveVoiceActive && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7LDJAXRXcjs.InputGroupAddon, { align: "block-start", className: "w-full cursor-default border-b border-border p-0 [.border-b]:pb-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
492
|
+
liveVoiceActive && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7LDJAXRXcjs.InputGroupAddon, { align: "block-start", className: "w-full cursor-default border-b border-border p-0 [.border-b]:pb-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHETZNLKTcjs.VoiceSessionControls, { ...voiceSession }) }),
|
|
493
493
|
attachments.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
494
494
|
ChatAttachmentList,
|
|
495
495
|
{
|
|
@@ -579,7 +579,7 @@ function ChatInput({
|
|
|
579
579
|
)
|
|
580
580
|
}
|
|
581
581
|
),
|
|
582
|
-
voiceSession && !liveVoiceActive && !hasText && attachments.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
582
|
+
voiceSession && !liveVoiceActive && !hasText && attachments.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHETZNLKTcjs.VoiceSessionControls, { ...voiceSession, disabled: voiceSession.disabled || isDisabled }) : submitLabel ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
583
583
|
_chunkJDEXZGIYcjs.Button,
|
|
584
584
|
{
|
|
585
585
|
type: "submit",
|
|
@@ -641,7 +641,7 @@ function VoiceHero({
|
|
|
641
641
|
}) {
|
|
642
642
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-5 py-6", children: [
|
|
643
643
|
voiceSession ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
644
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
644
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHETZNLKTcjs.VoiceSessionControls, { ...voiceSession, size: "hero" }),
|
|
645
645
|
voice && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
646
646
|
_chunkPH2TV7XIcjs.VoiceDictationButton,
|
|
647
647
|
{
|
package/dist/primitives/chat.js
CHANGED
|
@@ -8,14 +8,14 @@ import '@radix-ui/react-separator';
|
|
|
8
8
|
declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
9
9
|
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
|
|
10
10
|
declare const itemVariants: (props?: ({
|
|
11
|
-
variant?: "
|
|
11
|
+
variant?: "default" | "muted" | "outline" | null | undefined;
|
|
12
12
|
size?: "xs" | "sm" | "default" | null | undefined;
|
|
13
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
14
|
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
15
15
|
asChild?: boolean;
|
|
16
16
|
}): react_jsx_runtime.JSX.Element;
|
|
17
17
|
declare const itemMediaVariants: (props?: ({
|
|
18
|
-
variant?: "
|
|
18
|
+
variant?: "image" | "default" | "icon" | null | undefined;
|
|
19
19
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
20
20
|
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): react_jsx_runtime.JSX.Element;
|
|
21
21
|
declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
@@ -8,14 +8,14 @@ import '@radix-ui/react-separator';
|
|
|
8
8
|
declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
9
9
|
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
|
|
10
10
|
declare const itemVariants: (props?: ({
|
|
11
|
-
variant?: "
|
|
11
|
+
variant?: "default" | "muted" | "outline" | null | undefined;
|
|
12
12
|
size?: "xs" | "sm" | "default" | null | undefined;
|
|
13
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
14
|
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
15
15
|
asChild?: boolean;
|
|
16
16
|
}): react_jsx_runtime.JSX.Element;
|
|
17
17
|
declare const itemMediaVariants: (props?: ({
|
|
18
|
-
variant?: "
|
|
18
|
+
variant?: "image" | "default" | "icon" | null | undefined;
|
|
19
19
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
20
20
|
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): react_jsx_runtime.JSX.Element;
|
|
21
21
|
declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare const sectionHeaderVariants: (props?: ({
|
|
7
7
|
variant?: "muted" | "plain" | null | undefined;
|
|
8
|
-
spacing?: "
|
|
8
|
+
spacing?: "none" | "tight" | "loose" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLHeadingElement>, "children">, VariantProps<typeof sectionHeaderVariants> {
|
|
11
11
|
/** Pre-rendered icon node. Sized to match the header text. */
|
|
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare const sectionHeaderVariants: (props?: ({
|
|
7
7
|
variant?: "muted" | "plain" | null | undefined;
|
|
8
|
-
spacing?: "
|
|
8
|
+
spacing?: "none" | "tight" | "loose" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLHeadingElement>, "children">, VariantProps<typeof sectionHeaderVariants> {
|
|
11
11
|
/** Pre-rendered icon node. Sized to match the header text. */
|
|
@@ -5,11 +5,11 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
|
|
7
7
|
variant?: "default" | "outline" | null | undefined;
|
|
8
|
-
size?: "
|
|
8
|
+
size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
11
11
|
variant?: "default" | "outline" | null | undefined;
|
|
12
|
-
size?: "
|
|
12
|
+
size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
|
|
13
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
14
14
|
grow?: boolean;
|
|
15
15
|
textSize?: "inherit" | "xs";
|
|
@@ -5,11 +5,11 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
|
|
6
6
|
declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
|
|
7
7
|
variant?: "default" | "outline" | null | undefined;
|
|
8
|
-
size?: "
|
|
8
|
+
size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
11
11
|
variant?: "default" | "outline" | null | undefined;
|
|
12
|
-
size?: "
|
|
12
|
+
size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
|
|
13
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
14
14
|
grow?: boolean;
|
|
15
15
|
textSize?: "inherit" | "xs";
|
|
@@ -5,11 +5,11 @@ import * as React from 'react';
|
|
|
5
5
|
|
|
6
6
|
declare const toggleVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "outline" | null | undefined;
|
|
8
|
-
size?: "
|
|
8
|
+
size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
11
11
|
variant?: "default" | "outline" | null | undefined;
|
|
12
|
-
size?: "
|
|
12
|
+
size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
|
|
13
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
14
14
|
|
|
15
15
|
export { Toggle, toggleVariants };
|
|
@@ -5,11 +5,11 @@ import * as React from 'react';
|
|
|
5
5
|
|
|
6
6
|
declare const toggleVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "outline" | null | undefined;
|
|
8
|
-
size?: "
|
|
8
|
+
size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
11
11
|
variant?: "default" | "outline" | null | undefined;
|
|
12
|
-
size?: "
|
|
12
|
+
size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
|
|
13
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
14
14
|
|
|
15
15
|
export { Toggle, toggleVariants };
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkHETZNLKTcjs = require('../chunk-HETZNLKT.cjs');
|
|
6
6
|
require('../chunk-NKWHDI4C.cjs');
|
|
7
7
|
require('../chunk-JDEXZGIY.cjs');
|
|
8
8
|
require('../chunk-KWLSBTB2.cjs');
|
|
9
9
|
require('../chunk-2BSFYU22.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.VoiceSessionControls =
|
|
12
|
+
exports.VoiceSessionControls = _chunkHETZNLKTcjs.VoiceSessionControls;
|
|
@@ -22,10 +22,18 @@ interface VoiceSessionControlsProps {
|
|
|
22
22
|
/** Optional external audio store, so level changes only re-render these controls. */
|
|
23
23
|
audioLevels?: VoiceAudioLevelsSource;
|
|
24
24
|
labels?: Partial<Record<VoiceSessionState | "start" | "end" | "mute" | "unmute" | "muted" | "retry" | "endShort" | "muteShort" | "unmuteShort" | "transcriptPlaceholder", string>>;
|
|
25
|
+
/**
|
|
26
|
+
* Called when someone is about to start (the start control is hovered,
|
|
27
|
+
* pressed or focused), before the click lands. Hosts load their voice
|
|
28
|
+
* transport here so starting doesn't wait for it. It must never touch the
|
|
29
|
+
* microphone: capture belongs to `onStart`, so warming never prompts for
|
|
30
|
+
* permission. It can fire several times; make it idempotent.
|
|
31
|
+
*/
|
|
32
|
+
onWarm?: () => void;
|
|
25
33
|
size?: "icon" | "hero";
|
|
26
34
|
className?: string;
|
|
27
35
|
}
|
|
28
36
|
/** Transport-independent voice controls. The conversation stays visible while speaking. */
|
|
29
|
-
declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, onWarm, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
|
|
30
38
|
|
|
31
39
|
export { type VoiceAudioLevelsSource, VoiceSessionControls, type VoiceSessionControlsProps, type VoiceSessionState };
|
|
@@ -22,10 +22,18 @@ interface VoiceSessionControlsProps {
|
|
|
22
22
|
/** Optional external audio store, so level changes only re-render these controls. */
|
|
23
23
|
audioLevels?: VoiceAudioLevelsSource;
|
|
24
24
|
labels?: Partial<Record<VoiceSessionState | "start" | "end" | "mute" | "unmute" | "muted" | "retry" | "endShort" | "muteShort" | "unmuteShort" | "transcriptPlaceholder", string>>;
|
|
25
|
+
/**
|
|
26
|
+
* Called when someone is about to start (the start control is hovered,
|
|
27
|
+
* pressed or focused), before the click lands. Hosts load their voice
|
|
28
|
+
* transport here so starting doesn't wait for it. It must never touch the
|
|
29
|
+
* microphone: capture belongs to `onStart`, so warming never prompts for
|
|
30
|
+
* permission. It can fire several times; make it idempotent.
|
|
31
|
+
*/
|
|
32
|
+
onWarm?: () => void;
|
|
25
33
|
size?: "icon" | "hero";
|
|
26
34
|
className?: string;
|
|
27
35
|
}
|
|
28
36
|
/** Transport-independent voice controls. The conversation stays visible while speaking. */
|
|
29
|
-
declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, onWarm, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
|
|
30
38
|
|
|
31
39
|
export { type VoiceAudioLevelsSource, VoiceSessionControls, type VoiceSessionControlsProps, type VoiceSessionState };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkHETZNLKTcjs = require('../chunk-HETZNLKT.cjs');
|
|
6
6
|
require('../chunk-NKWHDI4C.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -139,7 +139,7 @@ var WorkflowAssistant = _react.forwardRef.call(void 0, function WorkflowAssistan
|
|
|
139
139
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJDEXZGIYcjs.Button, { type: "button", variant: "ghost", size: "icon", "aria-label": _nullishCoalesce(_optionalChain([labels, 'optionalAccess', _16 => _16.minimize]), () => ( "Minimize voice review")), onClick: () => toggle(false), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown, { "aria-hidden": "true" }) })
|
|
140
140
|
] }),
|
|
141
141
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "shrink-0", "data-slot": "workflow-assistant-voice", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
-
|
|
142
|
+
_chunkHETZNLKTcjs.VoiceSessionControls,
|
|
143
143
|
{
|
|
144
144
|
...voiceSession,
|
|
145
145
|
disabled: Boolean(startDisabled),
|
package/package.json
CHANGED
package/dist/chunk-KF4X37DP.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
AgentAudioVisualizerBar
|
|
4
|
-
} from "./chunk-5OF6D3GH.js";
|
|
5
|
-
import {
|
|
6
|
-
Button
|
|
7
|
-
} from "./chunk-W326GKML.js";
|
|
8
|
-
import {
|
|
9
|
-
cn
|
|
10
|
-
} from "./chunk-G6SRSWXB.js";
|
|
11
|
-
|
|
12
|
-
// src/primitives/voice-session-controls.tsx
|
|
13
|
-
import { useSyncExternalStore } from "react";
|
|
14
|
-
import { Mic, MicOff, Square, AudioLines } from "lucide-react";
|
|
15
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
var SILENCE = [];
|
|
17
|
-
var silence = () => SILENCE;
|
|
18
|
-
var noSubscription = () => () => {
|
|
19
|
-
};
|
|
20
|
-
var DEFAULT_LABELS = {
|
|
21
|
-
disconnected: "Voice chat",
|
|
22
|
-
connecting: "Connecting\u2026",
|
|
23
|
-
listening: "Listening\u2026",
|
|
24
|
-
thinking: "Thinking\u2026",
|
|
25
|
-
speaking: "Speaking",
|
|
26
|
-
reconnecting: "Reconnecting\u2026",
|
|
27
|
-
error: "Voice chat unavailable",
|
|
28
|
-
start: "Start voice chat",
|
|
29
|
-
end: "End voice chat",
|
|
30
|
-
mute: "Mute microphone",
|
|
31
|
-
unmute: "Unmute microphone",
|
|
32
|
-
muted: "Microphone muted",
|
|
33
|
-
retry: "Retry voice chat",
|
|
34
|
-
endShort: "End voice",
|
|
35
|
-
muteShort: "Mute",
|
|
36
|
-
unmuteShort: "Unmute"
|
|
37
|
-
};
|
|
38
|
-
function VoiceSessionControls({
|
|
39
|
-
state,
|
|
40
|
-
onStart,
|
|
41
|
-
onEnd,
|
|
42
|
-
muted = false,
|
|
43
|
-
onMutedChange,
|
|
44
|
-
disabled = false,
|
|
45
|
-
error,
|
|
46
|
-
volumeBands,
|
|
47
|
-
audioLevels,
|
|
48
|
-
labels,
|
|
49
|
-
size = "icon",
|
|
50
|
-
className
|
|
51
|
-
}) {
|
|
52
|
-
const liveBands = useSyncExternalStore(audioLevels?.subscribe ?? noSubscription, audioLevels?.getSnapshot ?? silence, silence);
|
|
53
|
-
const copy = { ...DEFAULT_LABELS, ...labels };
|
|
54
|
-
const active = state !== "disconnected" && state !== "error";
|
|
55
|
-
const waiting = state === "connecting" || state === "reconnecting";
|
|
56
|
-
return /* @__PURE__ */ jsxs(
|
|
57
|
-
"div",
|
|
58
|
-
{
|
|
59
|
-
"data-slot": "voice-session-controls",
|
|
60
|
-
"data-state": state,
|
|
61
|
-
className: cn("min-w-0", active ? "@container/voice w-full" : "flex flex-wrap items-center gap-2", className),
|
|
62
|
-
children: [
|
|
63
|
-
active ? /* @__PURE__ */ jsxs("div", { "data-slot": "voice-session-strip", className: "flex w-full flex-wrap items-center gap-4 bg-primary/5 p-4 @2xl/voice:flex-nowrap @2xl/voice:px-5", children: [
|
|
64
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 basis-full items-center gap-3 @2xl/voice:basis-auto @2xl/voice:gap-4", children: [
|
|
65
|
-
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: cn(
|
|
66
|
-
"flex size-12 shrink-0 items-center justify-center rounded-full ring-8 ring-primary/5 @sm/voice:size-14",
|
|
67
|
-
muted ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground"
|
|
68
|
-
), children: muted ? /* @__PURE__ */ jsx(MicOff, { className: "size-5" }) : /* @__PURE__ */ jsx(Mic, { className: "size-5" }) }),
|
|
69
|
-
/* @__PURE__ */ jsx(
|
|
70
|
-
AgentAudioVisualizerBar,
|
|
71
|
-
{
|
|
72
|
-
"aria-hidden": "true",
|
|
73
|
-
size: "sm",
|
|
74
|
-
barCount: 5,
|
|
75
|
-
className: "shrink-0 text-primary [&>div]:w-1",
|
|
76
|
-
state: muted && state === "listening" ? "disconnected" : state === "reconnecting" ? "connecting" : state,
|
|
77
|
-
volumeBands: muted && state === "listening" ? SILENCE : volumeBands ?? liveBands
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
/* @__PURE__ */ jsx("span", { role: "status", className: "min-w-0 flex-1 text-sm font-medium text-primary", children: muted && state === "listening" ? copy.muted : copy[state] })
|
|
81
|
-
] }),
|
|
82
|
-
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
83
|
-
/* @__PURE__ */ jsxs(
|
|
84
|
-
Button,
|
|
85
|
-
{
|
|
86
|
-
type: "button",
|
|
87
|
-
variant: "outline",
|
|
88
|
-
size: "sm",
|
|
89
|
-
className: "min-h-[44px] shrink-0 rounded-xl bg-background px-3 text-foreground",
|
|
90
|
-
"aria-label": muted ? copy.unmute : copy.mute,
|
|
91
|
-
title: muted ? copy.unmute : copy.mute,
|
|
92
|
-
"aria-pressed": muted,
|
|
93
|
-
disabled: waiting,
|
|
94
|
-
onClick: () => onMutedChange(!muted),
|
|
95
|
-
children: [
|
|
96
|
-
muted ? /* @__PURE__ */ jsx(Mic, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(MicOff, { "aria-hidden": "true" }),
|
|
97
|
-
muted ? copy.unmuteShort : copy.muteShort
|
|
98
|
-
]
|
|
99
|
-
}
|
|
100
|
-
),
|
|
101
|
-
/* @__PURE__ */ jsxs(
|
|
102
|
-
Button,
|
|
103
|
-
{
|
|
104
|
-
type: "button",
|
|
105
|
-
variant: "outline",
|
|
106
|
-
size: "sm",
|
|
107
|
-
className: "min-h-[44px] shrink-0 rounded-xl bg-background px-3 text-foreground",
|
|
108
|
-
"aria-label": copy.end,
|
|
109
|
-
title: copy.end,
|
|
110
|
-
onClick: onEnd,
|
|
111
|
-
children: [
|
|
112
|
-
/* @__PURE__ */ jsx(Square, { "aria-hidden": "true", className: "fill-current" }),
|
|
113
|
-
copy.endShort
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
] })
|
|
118
|
-
] }) : /* @__PURE__ */ jsx(
|
|
119
|
-
Button,
|
|
120
|
-
{
|
|
121
|
-
type: "button",
|
|
122
|
-
size: "icon",
|
|
123
|
-
shape: "circle",
|
|
124
|
-
disabled,
|
|
125
|
-
onClick: onStart,
|
|
126
|
-
"aria-label": state === "error" ? copy.retry : copy.start,
|
|
127
|
-
title: state === "error" ? copy.retry : copy.start,
|
|
128
|
-
className: cn("min-h-[44px] min-w-[44px] shrink-0 rounded-full", size === "hero" && "size-24 [&_svg]:size-7"),
|
|
129
|
-
children: /* @__PURE__ */ jsx(AudioLines, { "aria-hidden": "true" })
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
state === "error" && /* @__PURE__ */ jsx("span", { role: "alert", className: "basis-full text-xs text-destructive", children: error || copy.error })
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export {
|
|
139
|
-
VoiceSessionControls
|
|
140
|
-
};
|
package/dist/chunk-YMI3X2YL.cjs
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkNKWHDI4Ccjs = require('./chunk-NKWHDI4C.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkJDEXZGIYcjs = require('./chunk-JDEXZGIY.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _chunkKWLSBTB2cjs = require('./chunk-KWLSBTB2.cjs');
|
|
11
|
-
|
|
12
|
-
// src/primitives/voice-session-controls.tsx
|
|
13
|
-
var _react = require('react');
|
|
14
|
-
var _lucidereact = require('lucide-react');
|
|
15
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
16
|
-
var SILENCE = [];
|
|
17
|
-
var silence = () => SILENCE;
|
|
18
|
-
var noSubscription = () => () => {
|
|
19
|
-
};
|
|
20
|
-
var DEFAULT_LABELS = {
|
|
21
|
-
disconnected: "Voice chat",
|
|
22
|
-
connecting: "Connecting\u2026",
|
|
23
|
-
listening: "Listening\u2026",
|
|
24
|
-
thinking: "Thinking\u2026",
|
|
25
|
-
speaking: "Speaking",
|
|
26
|
-
reconnecting: "Reconnecting\u2026",
|
|
27
|
-
error: "Voice chat unavailable",
|
|
28
|
-
start: "Start voice chat",
|
|
29
|
-
end: "End voice chat",
|
|
30
|
-
mute: "Mute microphone",
|
|
31
|
-
unmute: "Unmute microphone",
|
|
32
|
-
muted: "Microphone muted",
|
|
33
|
-
retry: "Retry voice chat",
|
|
34
|
-
endShort: "End voice",
|
|
35
|
-
muteShort: "Mute",
|
|
36
|
-
unmuteShort: "Unmute"
|
|
37
|
-
};
|
|
38
|
-
function VoiceSessionControls({
|
|
39
|
-
state,
|
|
40
|
-
onStart,
|
|
41
|
-
onEnd,
|
|
42
|
-
muted = false,
|
|
43
|
-
onMutedChange,
|
|
44
|
-
disabled = false,
|
|
45
|
-
error,
|
|
46
|
-
volumeBands,
|
|
47
|
-
audioLevels,
|
|
48
|
-
labels,
|
|
49
|
-
size = "icon",
|
|
50
|
-
className
|
|
51
|
-
}) {
|
|
52
|
-
const liveBands = _react.useSyncExternalStore.call(void 0, _nullishCoalesce(_optionalChain([audioLevels, 'optionalAccess', _ => _.subscribe]), () => ( noSubscription)), _nullishCoalesce(_optionalChain([audioLevels, 'optionalAccess', _2 => _2.getSnapshot]), () => ( silence)), silence);
|
|
53
|
-
const copy = { ...DEFAULT_LABELS, ...labels };
|
|
54
|
-
const active = state !== "disconnected" && state !== "error";
|
|
55
|
-
const waiting = state === "connecting" || state === "reconnecting";
|
|
56
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
57
|
-
"div",
|
|
58
|
-
{
|
|
59
|
-
"data-slot": "voice-session-controls",
|
|
60
|
-
"data-state": state,
|
|
61
|
-
className: _chunkKWLSBTB2cjs.cn.call(void 0, "min-w-0", active ? "@container/voice w-full" : "flex flex-wrap items-center gap-2", className),
|
|
62
|
-
children: [
|
|
63
|
-
active ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-slot": "voice-session-strip", className: "flex w-full flex-wrap items-center gap-4 bg-primary/5 p-4 @2xl/voice:flex-nowrap @2xl/voice:px-5", children: [
|
|
64
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-1 basis-full items-center gap-3 @2xl/voice:basis-auto @2xl/voice:gap-4", children: [
|
|
65
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "aria-hidden": "true", className: _chunkKWLSBTB2cjs.cn.call(void 0,
|
|
66
|
-
"flex size-12 shrink-0 items-center justify-center rounded-full ring-8 ring-primary/5 @sm/voice:size-14",
|
|
67
|
-
muted ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground"
|
|
68
|
-
), children: muted ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MicOff, { className: "size-5" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Mic, { className: "size-5" }) }),
|
|
69
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
70
|
-
_chunkNKWHDI4Ccjs.AgentAudioVisualizerBar,
|
|
71
|
-
{
|
|
72
|
-
"aria-hidden": "true",
|
|
73
|
-
size: "sm",
|
|
74
|
-
barCount: 5,
|
|
75
|
-
className: "shrink-0 text-primary [&>div]:w-1",
|
|
76
|
-
state: muted && state === "listening" ? "disconnected" : state === "reconnecting" ? "connecting" : state,
|
|
77
|
-
volumeBands: muted && state === "listening" ? SILENCE : _nullishCoalesce(volumeBands, () => ( liveBands))
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "status", className: "min-w-0 flex-1 text-sm font-medium text-primary", children: muted && state === "listening" ? copy.muted : copy[state] })
|
|
81
|
-
] }),
|
|
82
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
83
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
84
|
-
_chunkJDEXZGIYcjs.Button,
|
|
85
|
-
{
|
|
86
|
-
type: "button",
|
|
87
|
-
variant: "outline",
|
|
88
|
-
size: "sm",
|
|
89
|
-
className: "min-h-[44px] shrink-0 rounded-xl bg-background px-3 text-foreground",
|
|
90
|
-
"aria-label": muted ? copy.unmute : copy.mute,
|
|
91
|
-
title: muted ? copy.unmute : copy.mute,
|
|
92
|
-
"aria-pressed": muted,
|
|
93
|
-
disabled: waiting,
|
|
94
|
-
onClick: () => onMutedChange(!muted),
|
|
95
|
-
children: [
|
|
96
|
-
muted ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Mic, { "aria-hidden": "true" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MicOff, { "aria-hidden": "true" }),
|
|
97
|
-
muted ? copy.unmuteShort : copy.muteShort
|
|
98
|
-
]
|
|
99
|
-
}
|
|
100
|
-
),
|
|
101
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
102
|
-
_chunkJDEXZGIYcjs.Button,
|
|
103
|
-
{
|
|
104
|
-
type: "button",
|
|
105
|
-
variant: "outline",
|
|
106
|
-
size: "sm",
|
|
107
|
-
className: "min-h-[44px] shrink-0 rounded-xl bg-background px-3 text-foreground",
|
|
108
|
-
"aria-label": copy.end,
|
|
109
|
-
title: copy.end,
|
|
110
|
-
onClick: onEnd,
|
|
111
|
-
children: [
|
|
112
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Square, { "aria-hidden": "true", className: "fill-current" }),
|
|
113
|
-
copy.endShort
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
] })
|
|
118
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
119
|
-
_chunkJDEXZGIYcjs.Button,
|
|
120
|
-
{
|
|
121
|
-
type: "button",
|
|
122
|
-
size: "icon",
|
|
123
|
-
shape: "circle",
|
|
124
|
-
disabled,
|
|
125
|
-
onClick: onStart,
|
|
126
|
-
"aria-label": state === "error" ? copy.retry : copy.start,
|
|
127
|
-
title: state === "error" ? copy.retry : copy.start,
|
|
128
|
-
className: _chunkKWLSBTB2cjs.cn.call(void 0, "min-h-[44px] min-w-[44px] shrink-0 rounded-full", size === "hero" && "size-24 [&_svg]:size-7"),
|
|
129
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AudioLines, { "aria-hidden": "true" })
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
state === "error" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "alert", className: "basis-full text-xs text-destructive", children: error || copy.error })
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
exports.VoiceSessionControls = VoiceSessionControls;
|