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.
@@ -1400,6 +1400,8 @@ var CardAudio = forwardRef(
1400
1400
  const [duration, setDuration] = useState(0);
1401
1401
  const [volume, setVolume] = useState(1);
1402
1402
  const [showVolumeControl, setShowVolumeControl] = useState(false);
1403
+ const [showSpeedMenu, setShowSpeedMenu] = useState(false);
1404
+ const [playbackRate, setPlaybackRate] = useState(1);
1403
1405
  const audioRef = useRef(null);
1404
1406
  const formatTime = (time) => {
1405
1407
  const minutes = Math.floor(time / 60);
@@ -1453,6 +1455,16 @@ var CardAudio = forwardRef(
1453
1455
  const toggleVolumeControl = () => {
1454
1456
  setShowVolumeControl(!showVolumeControl);
1455
1457
  };
1458
+ const toggleSpeedMenu = () => {
1459
+ setShowSpeedMenu(!showSpeedMenu);
1460
+ };
1461
+ const handleSpeedChange = (speed) => {
1462
+ setPlaybackRate(speed);
1463
+ if (audioRef.current) {
1464
+ audioRef.current.playbackRate = speed;
1465
+ }
1466
+ setShowSpeedMenu(false);
1467
+ };
1456
1468
  const getVolumeIcon = () => {
1457
1469
  if (volume === 0) {
1458
1470
  return /* @__PURE__ */ jsx5(SpeakerSimpleX, {});
@@ -1609,13 +1621,35 @@ var CardAudio = forwardRef(
1609
1621
  }
1610
1622
  )
1611
1623
  ] }),
1612
- /* @__PURE__ */ jsx5(
1613
- DotsThreeVertical,
1614
- {
1615
- size: 24,
1616
- className: "text-text-950 cursor-pointer hover:text-primary-600"
1617
- }
1618
- )
1624
+ /* @__PURE__ */ jsxs4("div", { className: "relative", children: [
1625
+ /* @__PURE__ */ jsx5(
1626
+ "button",
1627
+ {
1628
+ type: "button",
1629
+ onClick: toggleSpeedMenu,
1630
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
1631
+ "aria-label": "Op\xE7\xF5es de velocidade",
1632
+ children: /* @__PURE__ */ jsx5(DotsThreeVertical, { size: 24 })
1633
+ }
1634
+ ),
1635
+ 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: [
1636
+ { speed: 1, label: "1x" },
1637
+ { speed: 1.5, label: "1.5x" },
1638
+ { speed: 2, label: "2x" }
1639
+ ].map(({ speed, label }) => /* @__PURE__ */ jsx5(
1640
+ "button",
1641
+ {
1642
+ type: "button",
1643
+ onClick: () => handleSpeedChange(speed),
1644
+ className: cn(
1645
+ "px-3 py-1 text-sm text-left rounded hover:bg-border-50 transition-colors",
1646
+ playbackRate === speed ? "bg-primary-950 text-secondary-100 font-medium" : "text-text-950"
1647
+ ),
1648
+ children: label
1649
+ },
1650
+ speed
1651
+ )) }) })
1652
+ ] })
1619
1653
  ]
1620
1654
  }
1621
1655
  );