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.
package/dist/index.mjs CHANGED
@@ -4655,6 +4655,8 @@ var CardAudio = forwardRef12(
4655
4655
  const [duration, setDuration] = useState8(0);
4656
4656
  const [volume, setVolume] = useState8(1);
4657
4657
  const [showVolumeControl, setShowVolumeControl] = useState8(false);
4658
+ const [showSpeedMenu, setShowSpeedMenu] = useState8(false);
4659
+ const [playbackRate, setPlaybackRate] = useState8(1);
4658
4660
  const audioRef = useRef6(null);
4659
4661
  const formatTime2 = (time) => {
4660
4662
  const minutes = Math.floor(time / 60);
@@ -4708,6 +4710,16 @@ var CardAudio = forwardRef12(
4708
4710
  const toggleVolumeControl = () => {
4709
4711
  setShowVolumeControl(!showVolumeControl);
4710
4712
  };
4713
+ const toggleSpeedMenu = () => {
4714
+ setShowSpeedMenu(!showSpeedMenu);
4715
+ };
4716
+ const handleSpeedChange = (speed) => {
4717
+ setPlaybackRate(speed);
4718
+ if (audioRef.current) {
4719
+ audioRef.current.playbackRate = speed;
4720
+ }
4721
+ setShowSpeedMenu(false);
4722
+ };
4711
4723
  const getVolumeIcon = () => {
4712
4724
  if (volume === 0) {
4713
4725
  return /* @__PURE__ */ jsx26(SpeakerSimpleX, {});
@@ -4864,13 +4876,35 @@ var CardAudio = forwardRef12(
4864
4876
  }
4865
4877
  )
4866
4878
  ] }),
4867
- /* @__PURE__ */ jsx26(
4868
- DotsThreeVertical,
4869
- {
4870
- size: 24,
4871
- className: "text-text-950 cursor-pointer hover:text-primary-600"
4872
- }
4873
- )
4879
+ /* @__PURE__ */ jsxs20("div", { className: "relative", children: [
4880
+ /* @__PURE__ */ jsx26(
4881
+ "button",
4882
+ {
4883
+ type: "button",
4884
+ onClick: toggleSpeedMenu,
4885
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
4886
+ "aria-label": "Op\xE7\xF5es de velocidade",
4887
+ children: /* @__PURE__ */ jsx26(DotsThreeVertical, { size: 24 })
4888
+ }
4889
+ ),
4890
+ showSpeedMenu && /* @__PURE__ */ jsx26("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__ */ jsx26("div", { className: "flex flex-col gap-1", children: [
4891
+ { speed: 1, label: "1x" },
4892
+ { speed: 1.5, label: "1.5x" },
4893
+ { speed: 2, label: "2x" }
4894
+ ].map(({ speed, label }) => /* @__PURE__ */ jsx26(
4895
+ "button",
4896
+ {
4897
+ type: "button",
4898
+ onClick: () => handleSpeedChange(speed),
4899
+ className: cn(
4900
+ "px-3 py-1 text-sm text-left rounded hover:bg-border-50 transition-colors",
4901
+ playbackRate === speed ? "bg-primary-950 text-secondary-100 font-medium" : "text-text-950"
4902
+ ),
4903
+ children: label
4904
+ },
4905
+ speed
4906
+ )) }) })
4907
+ ] })
4874
4908
  ]
4875
4909
  }
4876
4910
  );