revdev-components 0.127.0 → 0.129.0

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.
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export interface AudioPlayerProps {
3
+ src: string;
4
+ className?: string;
5
+ }
6
+ export declare const AudioPlayer: React.FC<AudioPlayerProps>;
package/build/index.d.ts CHANGED
@@ -28,3 +28,4 @@ export * from "./attributor";
28
28
  export * from "./optionsAutocomplete";
29
29
  export * from "./button";
30
30
  export * from "./splitLine";
31
+ export * from "./audioPlayer";
package/build/index.js CHANGED
@@ -5511,12 +5511,35 @@ var SplitLine = function (_a) {
5511
5511
  return React.createElement("div", { className: classNames(s.root, className) });
5512
5512
  };
5513
5513
 
5514
+ var classes = {"root":"index-module_root__VVbaB","playing":"index-module_playing__v4q8X","play-animation":"index-module_play-animation__Y-ns-"};
5515
+
5516
+ var AudioPlayer = function (_a) {
5517
+ var _b;
5518
+ var src = _a.src, className = _a.className;
5519
+ var audioRef = React.useRef(null);
5520
+ var _c = React.useState(false), active = _c[0], setActive = _c[1];
5521
+ var handlePlay = React.useCallback(function () {
5522
+ if (audioRef.current) {
5523
+ if (audioRef.current.paused) {
5524
+ audioRef.current.play();
5525
+ }
5526
+ else {
5527
+ audioRef.current.pause();
5528
+ }
5529
+ }
5530
+ }, []);
5531
+ return (React.createElement("div", { className: classNames(classes.root, className) },
5532
+ React.createElement("audio", { ref: audioRef, src: src, onPlay: function () { return setActive(true); }, onPause: function () { return setActive(false); } }, "Your browser does not support the audio element."),
5533
+ React.createElement(Button, { onClick: handlePlay, icon: active ? "audio" : "play-arrow", className: classNames((_b = {}, _b[classes.playing] = active, _b)), isPrimary: active })));
5534
+ };
5535
+
5514
5536
  exports.AlfaAttributor = AlfaAttributor;
5515
5537
  exports.AlfaNavigator = AlfaNavigator;
5516
5538
  exports.AppForm = AppForm;
5517
5539
  exports.AppLink = AppLink;
5518
5540
  exports.AppLinkButton = AppLinkButton;
5519
5541
  exports.AppTooltip = AppTooltip;
5542
+ exports.AudioPlayer = AudioPlayer;
5520
5543
  exports.AutoCompleteField = AutoCompleteField;
5521
5544
  exports.BackLayout = BackLayout;
5522
5545
  exports.BackSidebar = BackSidebar;
package/build/styles.css CHANGED
@@ -637,4 +637,33 @@ body {
637
637
  border-top: 1px solid var(--splitLineColor);
638
638
  margin-top: 1em;
639
639
  margin-bottom: 1em;
640
+ }
641
+ .index-module_root__VVbaB {
642
+ display: flex;
643
+ }
644
+
645
+ .index-module_playing__v4q8X {
646
+ animation-name: index-module_play-animation__Y-ns-;
647
+ animation-duration: 1s;
648
+ animation-iteration-count: infinite;
649
+ transition: all 0.3s ease;
650
+ animation-timing-function: linear;
651
+ }
652
+
653
+ @keyframes index-module_play-animation__Y-ns- {
654
+ 0% {
655
+ transform: scale(1);
656
+ }
657
+ 25% {
658
+ transform: scale(0.9);
659
+ }
660
+ 50% {
661
+ transform: scale(1);
662
+ }
663
+ 75% {
664
+ transform: scale(1.1);
665
+ }
666
+ 100% {
667
+ transform: scale(1);
668
+ }
640
669
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.127.0",
3
+ "version": "0.129.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {