analytica-frontend-lib 1.1.13 → 1.1.14

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.
@@ -3225,6 +3225,8 @@ var CardAudio = forwardRef6(
3225
3225
  const [duration, setDuration] = useState3(0);
3226
3226
  const [volume, setVolume] = useState3(1);
3227
3227
  const [showVolumeControl, setShowVolumeControl] = useState3(false);
3228
+ const [showSpeedMenu, setShowSpeedMenu] = useState3(false);
3229
+ const [playbackRate, setPlaybackRate] = useState3(1);
3228
3230
  const audioRef = useRef3(null);
3229
3231
  const formatTime = (time) => {
3230
3232
  const minutes = Math.floor(time / 60);
@@ -3278,6 +3280,16 @@ var CardAudio = forwardRef6(
3278
3280
  const toggleVolumeControl = () => {
3279
3281
  setShowVolumeControl(!showVolumeControl);
3280
3282
  };
3283
+ const toggleSpeedMenu = () => {
3284
+ setShowSpeedMenu(!showSpeedMenu);
3285
+ };
3286
+ const handleSpeedChange = (speed) => {
3287
+ setPlaybackRate(speed);
3288
+ if (audioRef.current) {
3289
+ audioRef.current.playbackRate = speed;
3290
+ }
3291
+ setShowSpeedMenu(false);
3292
+ };
3281
3293
  const getVolumeIcon = () => {
3282
3294
  if (volume === 0) {
3283
3295
  return /* @__PURE__ */ jsx11(SpeakerSimpleX, {});
@@ -3434,13 +3446,35 @@ var CardAudio = forwardRef6(
3434
3446
  }
3435
3447
  )
3436
3448
  ] }),
3437
- /* @__PURE__ */ jsx11(
3438
- DotsThreeVertical,
3439
- {
3440
- size: 24,
3441
- className: "text-text-950 cursor-pointer hover:text-primary-600"
3442
- }
3443
- )
3449
+ /* @__PURE__ */ jsxs9("div", { className: "relative", children: [
3450
+ /* @__PURE__ */ jsx11(
3451
+ "button",
3452
+ {
3453
+ type: "button",
3454
+ onClick: toggleSpeedMenu,
3455
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
3456
+ "aria-label": "Op\xE7\xF5es de velocidade",
3457
+ children: /* @__PURE__ */ jsx11(DotsThreeVertical, { size: 24 })
3458
+ }
3459
+ ),
3460
+ showSpeedMenu && /* @__PURE__ */ jsx11("div", { className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg min-w-24 z-10", children: /* @__PURE__ */ jsx11("div", { className: "flex flex-col gap-1", children: [
3461
+ { speed: 1, label: "1x" },
3462
+ { speed: 1.5, label: "1.5x" },
3463
+ { speed: 2, label: "2x" }
3464
+ ].map(({ speed, label }) => /* @__PURE__ */ jsx11(
3465
+ "button",
3466
+ {
3467
+ type: "button",
3468
+ onClick: () => handleSpeedChange(speed),
3469
+ className: cn(
3470
+ "px-3 py-1 text-sm text-left rounded hover:bg-border-50 transition-colors",
3471
+ playbackRate === speed ? "bg-primary-950 text-secondary-100 font-medium" : "text-text-950"
3472
+ ),
3473
+ children: label
3474
+ },
3475
+ speed
3476
+ )) }) })
3477
+ ] })
3444
3478
  ]
3445
3479
  }
3446
3480
  );