@npm_leadtech/legal-lib-components 5.68.0 → 5.69.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.
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type VideoProps } from './VideoProps.types';
3
- declare const Video: ({ videoSrcURL, videoMimeType, title, controls, autoPlay, loop, muted, track }: VideoProps) => React.JSX.Element | null;
3
+ declare const Video: ({ videoSrcURL, videoMimeType, title, controls, autoPlay, loop, muted, track, preload, poster }: VideoProps) => React.JSX.Element | null;
4
4
  export default Video;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const Video = ({ videoSrcURL, videoMimeType = 'video/webm', title = '', controls = true, autoPlay = false, loop = false, muted = false, track }) => {
2
+ const Video = ({ videoSrcURL, videoMimeType = 'video/webm', title = '', controls = true, autoPlay = false, loop = false, muted = false, track, preload = 'auto', poster = '' }) => {
3
3
  if (!videoSrcURL)
4
4
  return null;
5
5
  return (
6
6
  // eslint-disable-next-line jsx-a11y/media-has-caption
7
- _jsxs("video", { "data-testid": 'video', title: title, controls: controls, autoPlay: autoPlay, loop: loop, muted: muted, children: [_jsx("source", { src: videoSrcURL, type: videoMimeType }), track && _jsx("track", { src: track.src, kind: track.kind, srcLang: track.srclang, label: track.label }), "Your browser does not support the video tag."] }));
7
+ _jsxs("video", { "data-testid": 'video', title: title, controls: controls, autoPlay: autoPlay, loop: loop, muted: muted, preload: preload, poster: poster, children: [_jsx("source", { src: videoSrcURL, type: videoMimeType }), track && _jsx("track", { src: track.src, kind: track.kind, srcLang: track.srclang, label: track.label }), "Your browser does not support the video tag."] }));
8
8
  };
9
9
  export default Video;
@@ -10,12 +10,23 @@ const Video = ({
10
10
  autoPlay = false,
11
11
  loop = false,
12
12
  muted = false,
13
- track
13
+ track,
14
+ preload = 'auto',
15
+ poster = ''
14
16
  }: VideoProps): React.JSX.Element | null => {
15
17
  if (!videoSrcURL) return null
16
18
  return (
17
19
  // eslint-disable-next-line jsx-a11y/media-has-caption
18
- <video data-testid='video' title={title} controls={controls} autoPlay={autoPlay} loop={loop} muted={muted}>
20
+ <video
21
+ data-testid='video'
22
+ title={title}
23
+ controls={controls}
24
+ autoPlay={autoPlay}
25
+ loop={loop}
26
+ muted={muted}
27
+ preload={preload}
28
+ poster={poster}
29
+ >
19
30
  <source src={videoSrcURL} type={videoMimeType} />
20
31
  {track && <track src={track.src} kind={track.kind} srcLang={track.srclang} label={track.label} />}
21
32
  Your browser does not support the video tag.
@@ -14,4 +14,6 @@ export interface VideoProps {
14
14
  srclang: string;
15
15
  label: string;
16
16
  };
17
+ preload?: 'auto' | 'metadata' | 'none';
18
+ poster?: string;
17
19
  }
@@ -14,4 +14,6 @@ export interface VideoProps {
14
14
  srclang: string
15
15
  label: string
16
16
  }
17
+ preload?: 'auto' | 'metadata' | 'none'
18
+ poster?: string
17
19
  }
@@ -3,11 +3,11 @@ import { StepsRatafiaContent } from '../../organisms';
3
3
  import { StepsRatafiaSectionStyled } from './StepsRatafiaSection.styled';
4
4
  import { Video } from '../../atoms';
5
5
  import classNames from 'classnames';
6
- const StepsRatafiaSection = ({ title, steps, videoUrl, mainImage, description }) => {
6
+ const StepsRatafiaSection = ({ title, steps, videoUrl, mainImage, description, videoPosterUrl }) => {
7
7
  const isEsignatureLanding = !videoUrl;
8
8
  const classnames = classNames({
9
9
  '--is-esignature': isEsignatureLanding
10
10
  });
11
- return (_jsx(StepsRatafiaSectionStyled, { className: 'steps-ratafia-section', children: _jsxs("div", { className: `steps-ratafia-section__wrapper ${classnames}`, children: [!isEsignatureLanding ? (_jsx("div", { className: 'steps-ratafia-section__wrapper__video', children: _jsx(Video, { videoSrcURL: videoUrl, autoPlay: true, loop: true }) })) : (_jsx("div", { className: 'steps-ratafia-section__wrapper__image', children: mainImage })), _jsx("div", { className: 'steps-ratafia-section__wrapper__content', children: _jsx(StepsRatafiaContent, { title: title, steps: steps, description: description }) })] }) }));
11
+ return (_jsx(StepsRatafiaSectionStyled, { className: 'steps-ratafia-section', children: _jsxs("div", { className: `steps-ratafia-section__wrapper ${classnames}`, children: [!isEsignatureLanding ? (_jsx("div", { className: 'steps-ratafia-section__wrapper__video', children: _jsx(Video, { videoSrcURL: videoUrl, preload: 'none', poster: videoPosterUrl }) })) : (_jsx("div", { className: 'steps-ratafia-section__wrapper__image', children: mainImage })), _jsx("div", { className: 'steps-ratafia-section__wrapper__content', children: _jsx(StepsRatafiaContent, { title: title, steps: steps, description: description }) })] }) }));
12
12
  };
13
13
  export default StepsRatafiaSection;
@@ -6,7 +6,14 @@ import { StepsRatafiaSectionStyled } from './StepsRatafiaSection.styled'
6
6
  import { Video } from '../../atoms'
7
7
  import classNames from 'classnames'
8
8
 
9
- const StepsRatafiaSection: FC<StepsRatafiaSectionProps> = ({ title, steps, videoUrl, mainImage, description }) => {
9
+ const StepsRatafiaSection: FC<StepsRatafiaSectionProps> = ({
10
+ title,
11
+ steps,
12
+ videoUrl,
13
+ mainImage,
14
+ description,
15
+ videoPosterUrl
16
+ }) => {
10
17
  const isEsignatureLanding = !videoUrl
11
18
  const classnames = classNames({
12
19
  '--is-esignature': isEsignatureLanding
@@ -17,7 +24,7 @@ const StepsRatafiaSection: FC<StepsRatafiaSectionProps> = ({ title, steps, video
17
24
  <div className={`steps-ratafia-section__wrapper ${classnames}`}>
18
25
  {!isEsignatureLanding ? (
19
26
  <div className='steps-ratafia-section__wrapper__video'>
20
- <Video videoSrcURL={videoUrl} autoPlay loop />
27
+ <Video videoSrcURL={videoUrl} preload='none' poster={videoPosterUrl} />
21
28
  </div>
22
29
  ) : (
23
30
  <div className='steps-ratafia-section__wrapper__image'>{mainImage}</div>
@@ -6,4 +6,5 @@ export interface StepsRatafiaSectionProps {
6
6
  videoUrl: string;
7
7
  mainImage?: React.ReactNode;
8
8
  description?: React.ReactNode;
9
+ videoPosterUrl?: string;
9
10
  }
@@ -7,4 +7,5 @@ export interface StepsRatafiaSectionProps {
7
7
  videoUrl: string
8
8
  mainImage?: React.ReactNode
9
9
  description?: React.ReactNode
10
+ videoPosterUrl?: string
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "5.68.0",
3
+ "version": "5.69.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",