analytica-frontend-lib 1.1.13 → 1.1.15

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.
@@ -1393,6 +1393,8 @@ var CardAudio = forwardRef(
1393
1393
  const [duration, setDuration] = useState(0);
1394
1394
  const [volume, setVolume] = useState(1);
1395
1395
  const [showVolumeControl, setShowVolumeControl] = useState(false);
1396
+ const [showSpeedMenu, setShowSpeedMenu] = useState(false);
1397
+ const [playbackRate, setPlaybackRate] = useState(1);
1396
1398
  const audioRef = useRef(null);
1397
1399
  const formatTime = (time) => {
1398
1400
  const minutes = Math.floor(time / 60);
@@ -1446,6 +1448,16 @@ var CardAudio = forwardRef(
1446
1448
  const toggleVolumeControl = () => {
1447
1449
  setShowVolumeControl(!showVolumeControl);
1448
1450
  };
1451
+ const toggleSpeedMenu = () => {
1452
+ setShowSpeedMenu(!showSpeedMenu);
1453
+ };
1454
+ const handleSpeedChange = (speed) => {
1455
+ setPlaybackRate(speed);
1456
+ if (audioRef.current) {
1457
+ audioRef.current.playbackRate = speed;
1458
+ }
1459
+ setShowSpeedMenu(false);
1460
+ };
1449
1461
  const getVolumeIcon = () => {
1450
1462
  if (volume === 0) {
1451
1463
  return /* @__PURE__ */ jsx5(SpeakerSimpleX, {});
@@ -1602,13 +1614,35 @@ var CardAudio = forwardRef(
1602
1614
  }
1603
1615
  )
1604
1616
  ] }),
1605
- /* @__PURE__ */ jsx5(
1606
- DotsThreeVertical,
1607
- {
1608
- size: 24,
1609
- className: "text-text-950 cursor-pointer hover:text-primary-600"
1610
- }
1611
- )
1617
+ /* @__PURE__ */ jsxs4("div", { className: "relative", children: [
1618
+ /* @__PURE__ */ jsx5(
1619
+ "button",
1620
+ {
1621
+ type: "button",
1622
+ onClick: toggleSpeedMenu,
1623
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
1624
+ "aria-label": "Op\xE7\xF5es de velocidade",
1625
+ children: /* @__PURE__ */ jsx5(DotsThreeVertical, { size: 24 })
1626
+ }
1627
+ ),
1628
+ showSpeedMenu && /* @__PURE__ */ jsx5("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__ */ jsx5("div", { className: "flex flex-col gap-1", children: [
1629
+ { speed: 1, label: "1x" },
1630
+ { speed: 1.5, label: "1.5x" },
1631
+ { speed: 2, label: "2x" }
1632
+ ].map(({ speed, label }) => /* @__PURE__ */ jsx5(
1633
+ "button",
1634
+ {
1635
+ type: "button",
1636
+ onClick: () => handleSpeedChange(speed),
1637
+ className: cn(
1638
+ "px-3 py-1 text-sm text-left rounded hover:bg-border-50 transition-colors",
1639
+ playbackRate === speed ? "bg-primary-950 text-secondary-100 font-medium" : "text-text-950"
1640
+ ),
1641
+ children: label
1642
+ },
1643
+ speed
1644
+ )) }) })
1645
+ ] })
1612
1646
  ]
1613
1647
  }
1614
1648
  );