@unctad-ai/voice-agent-ui 5.2.3 → 5.2.4

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.
@@ -5,7 +5,7 @@ import {
5
5
  SliderSetting,
6
6
  ToggleSetting,
7
7
  VoiceSettingsView
8
- } from "./chunk-LDKQCDOW.js";
8
+ } from "./chunk-XOTIV6ND.js";
9
9
  export {
10
10
  Divider,
11
11
  SelectSetting,
@@ -14,4 +14,4 @@ export {
14
14
  ToggleSetting,
15
15
  VoiceSettingsView as default
16
16
  };
17
- //# sourceMappingURL=VoiceSettingsView-6SD47AUN.js.map
17
+ //# sourceMappingURL=VoiceSettingsView-6LREXUTF.js.map
@@ -1902,7 +1902,7 @@ function VoiceSettingsView({ onBack, onVolumeChange }) {
1902
1902
  ) : /* @__PURE__ */ jsx3("span", {}),
1903
1903
  /* @__PURE__ */ jsxs2("span", { children: [
1904
1904
  "Kit v",
1905
- /* @__PURE__ */ jsx3("span", { style: { fontWeight: 500, color: "#6b7280" }, children: "5.2.3" })
1905
+ /* @__PURE__ */ jsx3("span", { style: { fontWeight: 500, color: "#6b7280" }, children: "5.2.4" })
1906
1906
  ] })
1907
1907
  ] }) })
1908
1908
  ]
@@ -1994,4 +1994,4 @@ export {
1994
1994
  SettingsSection,
1995
1995
  Divider
1996
1996
  };
1997
- //# sourceMappingURL=chunk-LDKQCDOW.js.map
1997
+ //# sourceMappingURL=chunk-XOTIV6ND.js.map
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  VoiceSettingsProvider,
9
9
  VoiceSettingsView,
10
10
  useVoiceSettings
11
- } from "./chunk-LDKQCDOW.js";
11
+ } from "./chunk-XOTIV6ND.js";
12
12
 
13
13
  // src/VoiceAgentProvider.tsx
14
14
  import { SiteConfigProvider } from "@unctad-ai/voice-agent-core";
@@ -33,7 +33,7 @@ import {
33
33
  } from "react";
34
34
  import { createPortal } from "react-dom";
35
35
  import { motion as motion5, AnimatePresence as AnimatePresence5, useReducedMotion as useReducedMotion2 } from "motion/react";
36
- import { ChevronDown as ChevronDown2, X, Mic as Mic3, ArrowUp, Keyboard as Keyboard2, RotateCw, Settings, VolumeX as VolumeX2, Flag as Flag2 } from "lucide-react";
36
+ import { ChevronDown as ChevronDown2, X, Mic as Mic3, MicOff as MicOff2, ArrowUp, Keyboard as Keyboard2, RotateCw, Settings, VolumeX as VolumeX2, Flag as Flag2 } from "lucide-react";
37
37
  import {
38
38
  useVoiceAgent,
39
39
  voiceStateToOrbState,
@@ -1764,15 +1764,15 @@ function PipelineMetricsBar({
1764
1764
 
1765
1765
  // src/components/GlassCopilotPanel.tsx
1766
1766
  import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1767
- var VoiceSettingsView2 = lazy(() => import("./VoiceSettingsView-6SD47AUN.js"));
1767
+ var VoiceSettingsView2 = lazy(() => import("./VoiceSettingsView-6LREXUTF.js"));
1768
1768
  var RETRY_INITIAL_MS = 3e3;
1769
1769
  var RETRY_MAX_MS = 3e4;
1770
1770
  var STATE_LABELS = {
1771
1771
  IDLE: "Tap mic to speak",
1772
- LISTENING: "Listening...",
1773
- USER_SPEAKING: "Listening...",
1774
- PROCESSING: "Processing...",
1775
- AI_SPEAKING: "Speaking..."
1772
+ LISTENING: "I'm listening...",
1773
+ USER_SPEAKING: "I'm listening...",
1774
+ PROCESSING: "Thinking...",
1775
+ AI_SPEAKING: "Responding..."
1776
1776
  };
1777
1777
  var ARIA_LIVE_LABELS = {
1778
1778
  idle: "",
@@ -2123,35 +2123,33 @@ function CollapsedBar({
2123
2123
  }
2124
2124
  )
2125
2125
  ] }),
2126
- !isOffline && onMicToggle && /* @__PURE__ */ jsxs8(
2127
- "button",
2128
- {
2129
- onClick: (e) => {
2130
- e.stopPropagation();
2131
- onMicToggle();
2132
- },
2133
- className: "shrink-0 rounded-full flex items-center justify-center transition-all cursor-pointer relative",
2134
- style: {
2135
- width: 44,
2136
- height: 44,
2137
- backgroundColor: voiceState === "LISTENING" || voiceState === "USER_SPEAKING" ? colors.primary : "rgba(0,0,0,0.06)",
2138
- color: voiceState === "LISTENING" || voiceState === "USER_SPEAKING" ? "white" : "rgba(0,0,0,0.45)"
2139
- },
2140
- "aria-label": voiceState === "LISTENING" || voiceState === "USER_SPEAKING" ? "Stop listening" : "Start listening",
2141
- children: [
2142
- (voiceState === "LISTENING" || voiceState === "USER_SPEAKING") && /* @__PURE__ */ jsx9(
2143
- motion5.span,
2144
- {
2145
- className: "absolute inset-0 rounded-full",
2146
- animate: { scale: [1, 1.3, 1], opacity: [0.3, 0, 0.3] },
2147
- transition: { duration: 1.8, repeat: Infinity, ease: "easeInOut" },
2148
- style: { backgroundColor: `${colors.primary}40` }
2149
- }
2150
- ),
2151
- /* @__PURE__ */ jsx9(Mic3, { style: { width: 16, height: 16, position: "relative", zIndex: 1 } })
2152
- ]
2153
- }
2154
- ),
2126
+ !isOffline && onMicToggle && (() => {
2127
+ const barListening = voiceState === "LISTENING" || voiceState === "USER_SPEAKING";
2128
+ return /* @__PURE__ */ jsx9(
2129
+ motion5.button,
2130
+ {
2131
+ onClick: (e) => {
2132
+ e.stopPropagation();
2133
+ onMicToggle();
2134
+ },
2135
+ whileHover: { scale: 1.08 },
2136
+ whileTap: { scale: 0.93 },
2137
+ animate: barListening ? { backgroundColor: [colors.primary, `${colors.primary}BB`, colors.primary] } : { backgroundColor: "rgba(0,0,0,0.06)" },
2138
+ transition: barListening ? { backgroundColor: { duration: 1.8, repeat: Infinity, ease: "easeInOut" } } : { duration: 0.3 },
2139
+ className: "shrink-0 rounded-full flex items-center justify-center cursor-pointer relative",
2140
+ style: {
2141
+ width: 44,
2142
+ height: 44,
2143
+ color: barListening ? "white" : "rgba(0,0,0,0.45)",
2144
+ border: "none",
2145
+ padding: 0,
2146
+ boxShadow: barListening ? `0 2px 8px ${colors.primary}40, 0 1px 3px rgba(0,0,0,0.12)` : "0 1px 4px rgba(0,0,0,0.10)"
2147
+ },
2148
+ "aria-label": barListening ? "Stop listening" : "Start listening",
2149
+ children: barListening ? /* @__PURE__ */ jsx9(Mic3, { style: { width: 16, height: 16, position: "relative", zIndex: 1 } }) : /* @__PURE__ */ jsx9(MicOff2, { style: { width: 16, height: 16, position: "relative", zIndex: 1 } })
2150
+ }
2151
+ );
2152
+ })(),
2155
2153
  isOffline && /* @__PURE__ */ jsx9(
2156
2154
  "span",
2157
2155
  {
@@ -2172,8 +2170,8 @@ function CollapsedBar({
2172
2170
  },
2173
2171
  className: "shrink-0 rounded-full flex items-center justify-center transition-colors cursor-pointer",
2174
2172
  style: {
2175
- width: 44,
2176
- height: 44,
2173
+ width: 32,
2174
+ height: 32,
2177
2175
  color: "rgba(0,0,0,0.4)"
2178
2176
  },
2179
2177
  onMouseEnter: (e) => {
@@ -2183,7 +2181,7 @@ function CollapsedBar({
2183
2181
  e.currentTarget.style.color = "rgba(0,0,0,0.4)";
2184
2182
  },
2185
2183
  "aria-label": "Close voice assistant",
2186
- children: /* @__PURE__ */ jsx9(X, { style: { width: 18, height: 18 } })
2184
+ children: /* @__PURE__ */ jsx9(X, { style: { width: 14, height: 14 } })
2187
2185
  }
2188
2186
  )
2189
2187
  ]
@@ -2288,7 +2286,7 @@ function ComposerBar({
2288
2286
  },
2289
2287
  "aria-label": isListening ? "Stop listening" : "Start listening",
2290
2288
  "data-testid": "voice-agent-mic",
2291
- children: /* @__PURE__ */ jsx9(Mic3, { style: { width: 18, height: 18, position: "relative", zIndex: 1 } })
2289
+ children: isListening ? /* @__PURE__ */ jsx9(Mic3, { style: { width: 18, height: 18, position: "relative", zIndex: 1 } }) : /* @__PURE__ */ jsx9(MicOff2, { style: { width: 18, height: 18, position: "relative", zIndex: 1 } })
2292
2290
  }
2293
2291
  ),
2294
2292
  /* @__PURE__ */ jsx9("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx9(AnimatePresence5, { mode: "wait", children: /* @__PURE__ */ jsx9(
@@ -2623,20 +2621,20 @@ function ExpandedContent({
2623
2621
  className: "shrink-0 rounded-full transition-colors cursor-pointer",
2624
2622
  style: {
2625
2623
  color: showSettings ? colors.primary : "rgba(0,0,0,0.4)",
2626
- width: 44,
2627
- height: 44,
2624
+ width: 32,
2625
+ height: 32,
2628
2626
  display: "flex",
2629
2627
  alignItems: "center",
2630
2628
  justifyContent: "center",
2631
- backgroundColor: showSettings ? `${colors.primary}14` : "rgba(0,0,0,0.05)"
2629
+ backgroundColor: showSettings ? `${colors.primary}14` : "transparent"
2632
2630
  },
2633
2631
  "aria-label": showSettings ? "Close settings" : "Open settings",
2634
2632
  "data-testid": "voice-agent-settings",
2635
- children: /* @__PURE__ */ jsx9(Settings, { style: { width: 16, height: 16 } })
2633
+ children: /* @__PURE__ */ jsx9(Settings, { style: { width: 14, height: 14 } })
2636
2634
  }
2637
2635
  ),
2638
- /* @__PURE__ */ jsx9("button", { onClick: onCollapse, className: "shrink-0 rounded-full transition-colors cursor-pointer", style: { color: "rgba(0,0,0,0.4)", width: 44, height: 44, display: "flex", alignItems: "center", justifyContent: "center", backgroundColor: "rgba(0,0,0,0.05)" }, "aria-label": "Minimize panel", "data-testid": "voice-agent-minimize", children: /* @__PURE__ */ jsx9(ChevronDown2, { style: { width: 16, height: 16 } }) }),
2639
- /* @__PURE__ */ jsx9("button", { onClick: onClose, className: "shrink-0 rounded-full transition-colors cursor-pointer", style: { color: "rgba(0,0,0,0.4)", width: 44, height: 44, display: "flex", alignItems: "center", justifyContent: "center", backgroundColor: "rgba(0,0,0,0.05)" }, "aria-label": "Close voice assistant", "data-testid": "voice-agent-close", children: /* @__PURE__ */ jsx9(X, { style: { width: 16, height: 16 } }) })
2636
+ /* @__PURE__ */ jsx9("button", { onClick: onCollapse, className: "shrink-0 rounded-full transition-colors cursor-pointer", style: { color: "rgba(0,0,0,0.4)", width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", backgroundColor: "transparent" }, "aria-label": "Minimize panel", "data-testid": "voice-agent-minimize", children: /* @__PURE__ */ jsx9(ChevronDown2, { style: { width: 14, height: 14 } }) }),
2637
+ /* @__PURE__ */ jsx9("button", { onClick: onClose, className: "shrink-0 rounded-full transition-colors cursor-pointer", style: { color: "rgba(0,0,0,0.4)", width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", backgroundColor: "transparent" }, "aria-label": "Close voice assistant", "data-testid": "voice-agent-close", children: /* @__PURE__ */ jsx9(X, { style: { width: 14, height: 14 } }) })
2640
2638
  ]
2641
2639
  }
2642
2640
  ),
@@ -2905,7 +2903,7 @@ function WiredPanelInner({
2905
2903
  timings: lastTimings ?? void 0,
2906
2904
  route: window.location.pathname,
2907
2905
  copilotName: config.copilotName,
2908
- kitVersion: "5.2.3"
2906
+ kitVersion: "5.2.4"
2909
2907
  })
2910
2908
  });
2911
2909
  const body = await res.json().catch(() => ({ ticketId: void 0 }));