@nnc-digital/nnc-design-system 1.0.0-alpha18 → 1.0.0-alpha20
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.js +51 -6
- package/build/index.js.map +1 -1
- package/build/index.mjs.js +51 -6
- package/build/index.mjs.js.map +1 -1
- package/package.json +1 -1
package/build/index.mjs.js
CHANGED
|
@@ -24136,7 +24136,7 @@ var VideoProvider;
|
|
|
24136
24136
|
VideoProvider["Vimeo"] = "Vimeo";
|
|
24137
24137
|
})(VideoProvider || (VideoProvider = {}));
|
|
24138
24138
|
|
|
24139
|
-
const VideoContainer = styled.figure`
|
|
24139
|
+
const VideoContainer$1 = styled.figure`
|
|
24140
24140
|
display: block;
|
|
24141
24141
|
padding-top: 56.25%;
|
|
24142
24142
|
position: relative;
|
|
@@ -24196,7 +24196,7 @@ var Video = function (_a) {
|
|
|
24196
24196
|
useEffect(function () {
|
|
24197
24197
|
setNotServer(true);
|
|
24198
24198
|
}, []);
|
|
24199
|
-
return (React.createElement(React.Fragment, null, cookiesAccepted && notServer ? (React.createElement(VideoContainer, { "data-testid": "Video" },
|
|
24199
|
+
return (React.createElement(React.Fragment, null, cookiesAccepted && notServer ? (React.createElement(VideoContainer$1, { "data-testid": "Video" },
|
|
24200
24200
|
React.createElement("iframe", { src: embedLink, title: description, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen;", "data-testid": "VideoIframe" }))) : (React.createElement(VideoLink, { href: watchLink, title: description, "data-testid": "VideoLink" }, description))));
|
|
24201
24201
|
};
|
|
24202
24202
|
|
|
@@ -25773,14 +25773,43 @@ const Search = styled.div`
|
|
|
25773
25773
|
margin: ${(props) => props.theme.theme_vars.spacingSizes.medium} 0;
|
|
25774
25774
|
`;
|
|
25775
25775
|
|
|
25776
|
+
const VideoContainer = styled.div`
|
|
25777
|
+
width: 100%;
|
|
25778
|
+
`;
|
|
25779
|
+
|
|
25776
25780
|
const VideoBackground = styled.video`
|
|
25777
25781
|
position: absolute;
|
|
25778
25782
|
top: 0;
|
|
25779
25783
|
left: 0;
|
|
25780
25784
|
width: 100%;
|
|
25781
|
-
height:
|
|
25785
|
+
height: 575px;
|
|
25782
25786
|
object-fit: cover;
|
|
25783
25787
|
z-index: -1;
|
|
25788
|
+
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.l}) {
|
|
25789
|
+
height: 540px;
|
|
25790
|
+
}
|
|
25791
|
+
`;
|
|
25792
|
+
|
|
25793
|
+
const PlayPauseButton = styled.button`
|
|
25794
|
+
position: absolute;
|
|
25795
|
+
bottom: 40px;
|
|
25796
|
+
right: 40px;
|
|
25797
|
+
background: rgba(0, 0, 0, 0.5);
|
|
25798
|
+
border: 1px solid white;
|
|
25799
|
+
color: white;
|
|
25800
|
+
font-size: 32px;
|
|
25801
|
+
border-radius: 50%;
|
|
25802
|
+
width: 50px;
|
|
25803
|
+
height: 50px;
|
|
25804
|
+
cursor: pointer;
|
|
25805
|
+
display: flex;
|
|
25806
|
+
align-items: center;
|
|
25807
|
+
justify-content: center;
|
|
25808
|
+
z-index: 10;
|
|
25809
|
+
|
|
25810
|
+
&:hover {
|
|
25811
|
+
background: rgba(0, 0, 0, 0.7);
|
|
25812
|
+
}
|
|
25784
25813
|
`;
|
|
25785
25814
|
|
|
25786
25815
|
/**
|
|
@@ -25789,13 +25818,29 @@ const VideoBackground = styled.video`
|
|
|
25789
25818
|
*/
|
|
25790
25819
|
var HeroImage = function (_a) {
|
|
25791
25820
|
var headline = _a.headline, content = _a.content, callToActionText = _a.callToActionText, callToActionURL = _a.callToActionURL, _b = _a.callToActionIsPrimary, callToActionIsPrimary = _b === void 0 ? true : _b, _c = _a.backgroundBox, backgroundBox = _c === void 0 ? true : _c, imageLarge = _a.imageLarge, imageSmall = _a.imageSmall, imageAltText = _a.imageAltText, heroVideoUrl = _a.heroVideoUrl, breadcrumb = _a.breadcrumb, customSearch = _a.customSearch;
|
|
25821
|
+
var _d = useState(true), isPlaying = _d[0], setIsPlaying = _d[1];
|
|
25822
|
+
var videoRef = useRef(null);
|
|
25823
|
+
var togglePlay = function () {
|
|
25824
|
+
if (videoRef.current) {
|
|
25825
|
+
if (isPlaying) {
|
|
25826
|
+
videoRef.current.pause();
|
|
25827
|
+
}
|
|
25828
|
+
else {
|
|
25829
|
+
videoRef.current.play();
|
|
25830
|
+
}
|
|
25831
|
+
setIsPlaying(!isPlaying);
|
|
25832
|
+
}
|
|
25833
|
+
};
|
|
25792
25834
|
return (React.createElement(React.Fragment, null,
|
|
25793
25835
|
React.createElement(LazyImage, { src: imageLarge, placeholder: imageSmall, visibilitySensorProps: {
|
|
25794
25836
|
partialVisibility: true,
|
|
25795
25837
|
} }, function (src) { return (React.createElement(Container$u, { "$image": src, "$backgroundBox": backgroundBox, "data-testid": "HeroImage" },
|
|
25796
|
-
heroVideoUrl && (React.createElement(
|
|
25797
|
-
React.createElement(
|
|
25798
|
-
|
|
25838
|
+
heroVideoUrl && (React.createElement(React.Fragment, null,
|
|
25839
|
+
React.createElement(VideoContainer, null,
|
|
25840
|
+
React.createElement(VideoBackground, { ref: videoRef, autoPlay: "false", loop: true, muted: true },
|
|
25841
|
+
React.createElement("source", { src: heroVideoUrl, type: "video/mp4" }),
|
|
25842
|
+
"Your browser doesn't support this video."),
|
|
25843
|
+
React.createElement(PlayPauseButton, { onClick: togglePlay }, isPlaying ? '⏸' : '▶')))),
|
|
25799
25844
|
React.createElement(InnerContainer, null,
|
|
25800
25845
|
React.createElement(Overlay, { "$backgroundBox": backgroundBox, "data-testid": "HeroImageOverlay" },
|
|
25801
25846
|
breadcrumb && (React.createElement(BreadcrumbLink, { href: breadcrumb.url, "$backgroundBox": backgroundBox }, breadcrumb.title)),
|