@trafilea/afrodita-components 6.34.8 → 6.35.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.
package/build/index.d.ts CHANGED
@@ -149,7 +149,7 @@ declare type StyledIconProps = {
149
149
 
150
150
  declare type Actions$1 = 'actions/add' | 'actions/check_box_empty' | 'actions/check_box_light' | 'actions/check_box_solid' | 'actions/check' | 'actions/circle_check' | 'actions/circle_clear' | 'actions/circle_info' | 'actions/circle_minus' | 'actions/circle_plus' | 'actions/circle_question' | 'actions/circle_solid_check' | 'actions/circle_solid_clear' | 'actions/circle_solid_info' | 'actions/circle_solid_minus' | 'actions/circle_solid_plus' | 'actions/circle_solid_question' | 'actions/circle_solid_styled_check' | 'actions/circle_solid_warning' | 'actions/circle_solid_reload' | 'actions/circle_warning' | 'actions/clear_light' | 'actions/close' | 'actions/copy_outlined' | 'actions/copy' | 'actions/edit' | 'actions/light_check' | 'actions/light_exclamation' | 'actions/like_solid' | 'actions/like' | 'actions/minus' | 'actions/not_allowed' | 'actions/question' | 'actions/radio_empty' | 'actions/radio_filled' | 'actions/settings_solid' | 'actions/settings' | 'actions/share' | 'actions/signout' | 'actions/signout_light' | 'actions/trash' | 'actions/warning' | 'actions/navigate' | 'actions/camera';
151
151
  declare type Arrows$1 = 'arrows/chevron_down' | 'arrows/chevron_down_variant' | 'arrows/chevron_left' | 'arrows/chevron_left_lite' | 'arrows/chevron_left_variant' | 'arrows/chevron_right' | 'arrows/chevron_right_lite' | 'arrows/chevron_right_variant' | 'arrows/chevron_up' | 'arrows/chevron_up_solid' | 'arrows/chevron_up_variant' | 'arrows/circle_chevron_down' | 'arrows/circle_chevron_left' | 'arrows/circle_chevron_right' | 'arrows/circle_chevron_up' | 'arrows/circle_line_down' | 'arrows/circle_line_left' | 'arrows/circle_line_right' | 'arrows/circle_line_up' | 'arrows/circle_up' | 'arrows/double_arrow_up' | 'arrows/chevron_right_grey' | 'arrows/circle_round' | 'arrows/circle_round_grayed';
152
- declare type Custom$1 = 'custom/atom' | 'custom/bra' | 'custom/bubbles' | 'custom/bullet_one' | 'custom/bullet_three' | 'custom/bullet_two' | 'custom/certified' | 'custom/clinically_tested' | 'custom/cruelty_free' | 'custom/fair_advantages' | 'custom/frown' | 'custom/money_flow' | 'custom/new_sixty_days_guarantee' | 'custom/packs_and_bundles' | 'custom/seamless_support_bra' | 'custom/sixty_days_bold' | 'custom/sixty_days_guarantee' | 'custom/smiling' | 'custom/subscription' | 'custom/thumbs_down' | 'custom/thumbs_up' | 'custom/underwear' | 'custom/wire_free_comfort' | 'custom/wire_free_comfort_bold' | 'custom/tk_sixty_days_bold' | 'custom/free_shipping_truck' | 'custom/higher_discounts' | 'custom/zoom' | 'custom/focus' | 'custom/beauty_face' | 'custom/bar' | 'custom/ears' | 'custom/pain' | 'custom/rociar' | 'custom/star' | 'custom/time' | 'custom/winter_light' | 'custom/priority_support' | 'custom/sound_on' | 'custom/sound_off' | 'custom/gift_thin' | 'custom/returns' | 'custom/paint_brush' | 'custom/savings';
152
+ declare type Custom$1 = 'custom/atom' | 'custom/avatar_placeholder' | 'custom/bra' | 'custom/bubbles' | 'custom/bullet_one' | 'custom/bullet_three' | 'custom/bullet_two' | 'custom/certified' | 'custom/clinically_tested' | 'custom/cruelty_free' | 'custom/fair_advantages' | 'custom/frown' | 'custom/money_flow' | 'custom/new_sixty_days_guarantee' | 'custom/packs_and_bundles' | 'custom/seamless_support_bra' | 'custom/sixty_days_bold' | 'custom/sixty_days_guarantee' | 'custom/smiling' | 'custom/subscription' | 'custom/thumbs_down' | 'custom/thumbs_up' | 'custom/underwear' | 'custom/wire_free_comfort' | 'custom/wire_free_comfort_bold' | 'custom/tk_sixty_days_bold' | 'custom/free_shipping_truck' | 'custom/higher_discounts' | 'custom/zoom' | 'custom/focus' | 'custom/beauty_face' | 'custom/bar' | 'custom/ears' | 'custom/pain' | 'custom/rociar' | 'custom/star' | 'custom/time' | 'custom/winter_light' | 'custom/priority_support' | 'custom/sound_on' | 'custom/sound_off' | 'custom/gift_thin' | 'custom/returns' | 'custom/paint_brush' | 'custom/savings';
153
153
  declare type Download$1 = 'download/apple_store' | 'download/google_play';
154
154
  declare type Emoji$1 = 'emoji/blowing_kiss' | 'emoji/frowning' | 'emoji/grinning' | 'emoji/grinning_with_sweat' | 'emoji/relieved' | 'emoji/smiling_v2' | 'emoji/smiling_v3' | 'emoji/thinking';
155
155
  declare type Messaging$1 = 'messaging/ada_chat' | 'messaging/comment' | 'messaging/comment_dots' | 'messaging/comment_light' | 'messaging/comment_money' | 'messaging/community' | 'messaging/light' | 'messaging/light_bulb' | 'messaging/light_bulb_solid' | 'messaging/mail' | 'messaging/messenger' | 'messaging/question_circle' | 'messaging/quote_left' | 'messaging/quote_right' | 'messaging/quote_solid_left' | 'messaging/quote_solid_right' | 'messaging/question_circle_light';
@@ -3804,6 +3804,7 @@ declare type VideoProps = {
3804
3804
  height?: string;
3805
3805
  hasAudioControl?: boolean;
3806
3806
  withProgressBar?: boolean;
3807
+ isSlideActive?: boolean;
3807
3808
  } & DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
3808
3809
  declare const Video: React.FC<VideoProps>;
3809
3810
 
@@ -12172,7 +12172,7 @@ var templateObject_1$1a, templateObject_2$T, templateObject_3$J, templateObject_
12172
12172
 
12173
12173
  var Video$1 = function (_a) {
12174
12174
  var _b, _c, _d, _e;
12175
- var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, _f = _a.withProgressBar, withProgressBar = _f === void 0 ? true : _f, hasAudioControl = _a.hasAudioControl, muted = _a.muted, rest = __rest(_a, ["source", "thumbnail", "height", "className", "withProgressBar", "hasAudioControl", "muted"]);
12175
+ var source = _a.source, thumbnail = _a.thumbnail, height = _a.height, className = _a.className, _f = _a.withProgressBar, withProgressBar = _f === void 0 ? true : _f, hasAudioControl = _a.hasAudioControl, muted = _a.muted, isSlideActive = _a.isSlideActive, rest = __rest(_a, ["source", "thumbnail", "height", "className", "withProgressBar", "hasAudioControl", "muted", "isSlideActive"]);
12176
12176
  var videoRef = useRef(null);
12177
12177
  var _g = useState(true), isLoading = _g[0], setIsLoading = _g[1];
12178
12178
  var _h = useState(false), isPlaying = _h[0], setIsPlaying = _h[1];
@@ -12182,11 +12182,11 @@ var Video$1 = function (_a) {
12182
12182
  var isStarted = videoProgress > 0;
12183
12183
  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);
12184
12184
  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;
12185
- useEffect(function () {
12186
- if (videoRef.current) {
12187
- videoRef.current.muted = Boolean(muted);
12185
+ if (isSlideActive !== undefined) {
12186
+ if (!isMuted && !isSlideActive && videoRef.current) {
12187
+ setIsMuted(true);
12188
12188
  }
12189
- }, [muted]);
12189
+ }
12190
12190
  var handlePlayClick = function () {
12191
12191
  if (videoRef.current && !debouncePlay) {
12192
12192
  setDebouncePlay(true);
@@ -12210,7 +12210,6 @@ var Video$1 = function (_a) {
12210
12210
  };
12211
12211
  var handleMuteToggle = function () {
12212
12212
  if (videoRef.current) {
12213
- videoRef.current.muted = !videoRef.current.muted;
12214
12213
  setIsMuted(function (prevState) { return !prevState; });
12215
12214
  }
12216
12215
  };
@@ -12219,7 +12218,7 @@ var Video$1 = function (_a) {
12219
12218
  setVideoProgress(videoRef.current.currentTime);
12220
12219
  }
12221
12220
  };
12222
- return (jsxs$1(Container$S, __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)), hasAudioControl && (jsxs$1(MuteButton, __assign$1({ onClick: handleMuteToggle }, { children: [isMuted && jsx$1(Icon$1, { name: "custom/sound_off" }, void 0), !isMuted && jsx$1(Icon$1, { name: "custom/sound_on" }, void 0)] }), void 0)), jsxs$1(HTMLVideo, __assign$1({}, rest, { muted: true, "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));
12221
+ return (jsxs$1(Container$S, __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)), hasAudioControl && (jsxs$1(MuteButton, __assign$1({ onClick: handleMuteToggle }, { children: [isMuted && jsx$1(Icon$1, { name: "custom/sound_off" }, void 0), !isMuted && jsx$1(Icon$1, { name: "custom/sound_on" }, void 0)] }), void 0)), jsxs$1(HTMLVideo, __assign$1({}, rest, { muted: isMuted, "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));
12223
12222
  };
12224
12223
 
12225
12224
  var propTypes = {exports: {}};