sera-ai 1.0.17 → 1.0.19

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/index.d.mts CHANGED
@@ -13,6 +13,7 @@ interface AudioRecorderProps {
13
13
  onSuccess?: (data: any) => void;
14
14
  onError?: (error: string) => void;
15
15
  className?: string;
16
+ visualizerClassName?: string;
16
17
  style?: React.CSSProperties;
17
18
  }
18
19
  interface APIResponse<T = any> {
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ interface AudioRecorderProps {
13
13
  onSuccess?: (data: any) => void;
14
14
  onError?: (error: string) => void;
15
15
  className?: string;
16
+ visualizerClassName?: string;
16
17
  style?: React.CSSProperties;
17
18
  }
18
19
  interface APIResponse<T = any> {
package/dist/index.js CHANGED
@@ -3872,8 +3872,9 @@ function createParticle(isIdle, x, y, intensity = 1) {
3872
3872
  function AudioVisualizerImproved({
3873
3873
  mediaStream,
3874
3874
  isRecording,
3875
- forceLight = true
3875
+ forceLight = true,
3876
3876
  // Default to light theme for login page
3877
+ className
3877
3878
  }) {
3878
3879
  const canvasRef = React3__namespace.useRef(null);
3879
3880
  const animationFrameRef = React3__namespace.useRef(0);
@@ -4016,6 +4017,7 @@ function AudioVisualizerImproved({
4016
4017
  ctx.fillStyle = isDarkMode ? "#121826" : "#ffffff";
4017
4018
  ctx.fillRect(0, 0, canvas.width, canvas.height);
4018
4019
  const createDynamicBackground = () => {
4020
+ if (!isDarkMode) return;
4019
4021
  const pulseIntensity = 0.5 + (isRecording ? avgAudioLevel * 0.5 : Math.sin(timeRef.current * 0.2) * 0.2);
4020
4022
  const mainGradient = ctx.createRadialGradient(
4021
4023
  centerX,
@@ -4025,17 +4027,10 @@ function AudioVisualizerImproved({
4025
4027
  centerY,
4026
4028
  canvas.width * 0.6 * pulseIntensity
4027
4029
  );
4028
- if (isDarkMode) {
4029
- mainGradient.addColorStop(0, "rgba(91, 33, 182, 0.4)");
4030
- mainGradient.addColorStop(0.4, "rgba(67, 56, 202, 0.3)");
4031
- mainGradient.addColorStop(0.6, "rgba(30, 41, 59, 0.2)");
4032
- mainGradient.addColorStop(1, "rgba(18, 24, 38, 0.0)");
4033
- } else {
4034
- mainGradient.addColorStop(0, "rgba(228, 228, 255, 0.7)");
4035
- mainGradient.addColorStop(0.4, "rgba(240, 240, 255, 0.5)");
4036
- mainGradient.addColorStop(0.6, "rgba(245, 245, 255, 0.3)");
4037
- mainGradient.addColorStop(1, "rgba(255, 255, 255, 0.0)");
4038
- }
4030
+ mainGradient.addColorStop(0, "rgba(91, 33, 182, 0.4)");
4031
+ mainGradient.addColorStop(0.4, "rgba(67, 56, 202, 0.3)");
4032
+ mainGradient.addColorStop(0.6, "rgba(30, 41, 59, 0.2)");
4033
+ mainGradient.addColorStop(1, "rgba(18, 24, 38, 0.0)");
4039
4034
  ctx.fillStyle = mainGradient;
4040
4035
  ctx.fillRect(0, 0, canvas.width, canvas.height);
4041
4036
  const lightCount = 3;
@@ -4241,7 +4236,7 @@ function AudioVisualizerImproved({
4241
4236
  }
4242
4237
  };
4243
4238
  }, [mediaStream, isRecording, isDarkMode]);
4244
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full flex justify-center items-center overflow-visible", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 w-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full aspect-square max-w-lg mx-auto relative", children: [
4239
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full flex justify-center items-center overflow-visible ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full mx-auto relative", children: [
4245
4240
  /* @__PURE__ */ jsxRuntime.jsx(
4246
4241
  "div",
4247
4242
  {
@@ -4386,6 +4381,7 @@ var AudioRecorder = ({
4386
4381
  onSuccess,
4387
4382
  onError,
4388
4383
  className = "",
4384
+ visualizerClassName = "",
4389
4385
  style
4390
4386
  }) => {
4391
4387
  React3__namespace.useEffect(() => {
@@ -4552,12 +4548,13 @@ var AudioRecorder = ({
4552
4548
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-xs text-blue-600 dark:text-blue-400 mt-1", children: "Please wait while we process your recording" })
4553
4549
  ] })
4554
4550
  ] }),
4555
- isRecording && !isPaused && mediaStreamRef.current && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full max-w-lg mx-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
4551
+ isRecording && !isPaused && mediaStreamRef.current && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full ${visualizerClassName || "max-w-lg"} mx-auto`, children: /* @__PURE__ */ jsxRuntime.jsx(
4556
4552
  AudioVisualizerImproved,
4557
4553
  {
4558
4554
  mediaStream: mediaStreamRef.current,
4559
4555
  isRecording: isRecording && !isPaused,
4560
- forceLight: false
4556
+ forceLight: false,
4557
+ className: visualizerClassName
4561
4558
  }
4562
4559
  ) }),
4563
4560
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: isProcessing ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center space-x-2 bg-teal-600 hover:bg-teal-700 text-white py-2 px-4 rounded-full", children: [