@trafilea/afrodita-components 6.21.2 → 6.21.3

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/build/index.d.ts CHANGED
@@ -3673,6 +3673,7 @@ declare type VideoProps = {
3673
3673
  thumbnail: string;
3674
3674
  source: string;
3675
3675
  height?: string;
3676
+ withProgressBar?: boolean;
3676
3677
  } & DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
3677
3678
  declare const Video: React.FC<VideoProps>;
3678
3679
 
@@ -13591,12 +13591,12 @@ var templateObject_1$11, templateObject_2$J, templateObject_3$A, templateObject_
13591
13591
 
13592
13592
  var Video$1 = function (_a) {
13593
13593
  var _b, _c, _d, _e;
13594
- var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, rest = __rest(_a, ["source", "thumbnail", "height", "className"]);
13594
+ var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, _f = _a.withProgressBar, withProgressBar = _f === void 0 ? true : _f, rest = __rest(_a, ["source", "thumbnail", "height", "className", "withProgressBar"]);
13595
13595
  var videoRef = useRef(null);
13596
- var _f = useState(true), isLoading = _f[0], setIsLoading = _f[1];
13597
- var _g = useState(false), isPlaying = _g[0], setIsPlaying = _g[1];
13598
- var _h = useState(0), videoProgress = _h[0], setVideoProgress = _h[1];
13599
- var _j = useState(false), debouncePlay = _j[0], setDebouncePlay = _j[1];
13596
+ var _g = useState(true), isLoading = _g[0], setIsLoading = _g[1];
13597
+ var _h = useState(false), isPlaying = _h[0], setIsPlaying = _h[1];
13598
+ var _j = useState(0), videoProgress = _j[0], setVideoProgress = _j[1];
13599
+ var _k = useState(false), debouncePlay = _k[0], setDebouncePlay = _k[1];
13600
13600
  var isStarted = videoProgress > 0;
13601
13601
  var progress = videoProgress / ((_c = (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.duration) !== null && _c !== void 0 ? _c : 0);
13602
13602
  var hideProgressBar = videoProgress === ((_e = (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.duration) !== null && _e !== void 0 ? _e : 0) || videoProgress === 0;
@@ -13626,7 +13626,7 @@ var Video$1 = function (_a) {
13626
13626
  setVideoProgress(videoRef.current.currentTime);
13627
13627
  }
13628
13628
  };
13629
- return (jsxs$1(Container$O, __assign$1({ className: className }, { children: [!isLoading && jsx$1(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsx$1(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsx$1(PlayIcon, {}, void 0) }), void 0)) : (jsx$1(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), jsxs$1(HTMLVideo, __assign$1({}, rest, { "data-testid": "video", poster: thumbnail, playsInline: true, ref: videoRef, onTimeUpdate: onTimeUpdate, onCanPlay: function () { return setIsLoading(false); }, onLoadedData: function () { return setIsLoading(false); }, onPause: function () { return setIsPlaying(false); }, onPlaying: function () { return setIsPlaying(true); }, height: height || 'auto' }, { children: [jsx$1("track", { kind: "captions" }, void 0), jsx$1("source", { src: source }, void 0)] }), void 0)] }), void 0));
13629
+ return (jsxs$1(Container$O, __assign$1({ className: className }, { children: [!isLoading && withProgressBar && jsx$1(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsx$1(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsx$1(PlayIcon, {}, void 0) }), void 0)) : (jsx$1(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), jsxs$1(HTMLVideo, __assign$1({}, rest, { "data-testid": "video", poster: thumbnail, playsInline: true, ref: videoRef, onTimeUpdate: onTimeUpdate, onCanPlay: function () { return setIsLoading(false); }, onLoadedData: function () { return setIsLoading(false); }, onPause: function () { return setIsPlaying(false); }, onPlaying: function () { return setIsPlaying(true); }, height: height || 'auto' }, { children: [jsx$1("track", { kind: "captions" }, void 0), jsx$1("source", { src: source }, void 0)] }), void 0)] }), void 0));
13630
13630
  };
13631
13631
 
13632
13632
  var Container$N = newStyled.div(templateObject_1$10 || (templateObject_1$10 = __makeTemplateObject(["\n ", "\n z-index: 0;\n position: relative;\n height: fit-content;\n /* &.styleforhorizontal {\n height: 30rem;\n } */\n display: block;\n overflow: hidden;\n white-space: nowrap;\n grid-area: 1/2;\n width: 100%;\n max-width: max-content;\n"], ["\n ", "\n z-index: 0;\n position: relative;\n height: fit-content;\n /* &.styleforhorizontal {\n height: 30rem;\n } */\n display: block;\n overflow: hidden;\n white-space: nowrap;\n grid-area: 1/2;\n width: 100%;\n max-width: max-content;\n"])), function (_a) {
package/build/index.js CHANGED
@@ -13617,12 +13617,12 @@ var templateObject_1$11, templateObject_2$J, templateObject_3$A, templateObject_
13617
13617
 
13618
13618
  var Video$1 = function (_a) {
13619
13619
  var _b, _c, _d, _e;
13620
- var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, rest = __rest(_a, ["source", "thumbnail", "height", "className"]);
13620
+ var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, _f = _a.withProgressBar, withProgressBar = _f === void 0 ? true : _f, rest = __rest(_a, ["source", "thumbnail", "height", "className", "withProgressBar"]);
13621
13621
  var videoRef = React$2.useRef(null);
13622
- var _f = React$2.useState(true), isLoading = _f[0], setIsLoading = _f[1];
13623
- var _g = React$2.useState(false), isPlaying = _g[0], setIsPlaying = _g[1];
13624
- var _h = React$2.useState(0), videoProgress = _h[0], setVideoProgress = _h[1];
13625
- var _j = React$2.useState(false), debouncePlay = _j[0], setDebouncePlay = _j[1];
13622
+ var _g = React$2.useState(true), isLoading = _g[0], setIsLoading = _g[1];
13623
+ var _h = React$2.useState(false), isPlaying = _h[0], setIsPlaying = _h[1];
13624
+ var _j = React$2.useState(0), videoProgress = _j[0], setVideoProgress = _j[1];
13625
+ var _k = React$2.useState(false), debouncePlay = _k[0], setDebouncePlay = _k[1];
13626
13626
  var isStarted = videoProgress > 0;
13627
13627
  var progress = videoProgress / ((_c = (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.duration) !== null && _c !== void 0 ? _c : 0);
13628
13628
  var hideProgressBar = videoProgress === ((_e = (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.duration) !== null && _e !== void 0 ? _e : 0) || videoProgress === 0;
@@ -13652,7 +13652,7 @@ var Video$1 = function (_a) {
13652
13652
  setVideoProgress(videoRef.current.currentTime);
13653
13653
  }
13654
13654
  };
13655
- return (jsxRuntime.jsxs(Container$O, __assign$1({ className: className }, { children: [!isLoading && jsxRuntime.jsx(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsxRuntime.jsx(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsxRuntime.jsx(PlayIcon, {}, void 0) }), void 0)) : (jsxRuntime.jsx(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), jsxRuntime.jsxs(HTMLVideo, __assign$1({}, rest, { "data-testid": "video", poster: thumbnail, playsInline: true, ref: videoRef, onTimeUpdate: onTimeUpdate, onCanPlay: function () { return setIsLoading(false); }, onLoadedData: function () { return setIsLoading(false); }, onPause: function () { return setIsPlaying(false); }, onPlaying: function () { return setIsPlaying(true); }, height: height || 'auto' }, { children: [jsxRuntime.jsx("track", { kind: "captions" }, void 0), jsxRuntime.jsx("source", { src: source }, void 0)] }), void 0)] }), void 0));
13655
+ return (jsxRuntime.jsxs(Container$O, __assign$1({ className: className }, { children: [!isLoading && withProgressBar && jsxRuntime.jsx(ProgressBar$1, { progress: progress, hide: hideProgressBar }, void 0), !isPlaying ? (jsxRuntime.jsx(PlayContainer, __assign$1({ "data-testid": "play", onClick: handlePlayClick }, { children: isStarted && jsxRuntime.jsx(PlayIcon, {}, void 0) }), void 0)) : (jsxRuntime.jsx(PauseContainer, { "data-testid": "pause", onClick: handlePauseClick }, void 0)), jsxRuntime.jsxs(HTMLVideo, __assign$1({}, rest, { "data-testid": "video", poster: thumbnail, playsInline: true, ref: videoRef, onTimeUpdate: onTimeUpdate, onCanPlay: function () { return setIsLoading(false); }, onLoadedData: function () { return setIsLoading(false); }, onPause: function () { return setIsPlaying(false); }, onPlaying: function () { return setIsPlaying(true); }, height: height || 'auto' }, { children: [jsxRuntime.jsx("track", { kind: "captions" }, void 0), jsxRuntime.jsx("source", { src: source }, void 0)] }), void 0)] }), void 0));
13656
13656
  };
13657
13657
 
13658
13658
  var Container$N = newStyled.div(templateObject_1$10 || (templateObject_1$10 = __makeTemplateObject(["\n ", "\n z-index: 0;\n position: relative;\n height: fit-content;\n /* &.styleforhorizontal {\n height: 30rem;\n } */\n display: block;\n overflow: hidden;\n white-space: nowrap;\n grid-area: 1/2;\n width: 100%;\n max-width: max-content;\n"], ["\n ", "\n z-index: 0;\n position: relative;\n height: fit-content;\n /* &.styleforhorizontal {\n height: 30rem;\n } */\n display: block;\n overflow: hidden;\n white-space: nowrap;\n grid-area: 1/2;\n width: 100%;\n max-width: max-content;\n"])), function (_a) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Trafilea's Design System",
4
4
  "author": "Trafilea",
5
5
  "repository": "https://github.com/trafilea/afrodita-components",
6
- "version": "6.21.2",
6
+ "version": "6.21.3",
7
7
  "private": false,
8
8
  "main": "build/index.js",
9
9
  "style": "build/index.css",