@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.js
CHANGED
|
@@ -24149,7 +24149,7 @@ var VideoProvider;
|
|
|
24149
24149
|
VideoProvider["Vimeo"] = "Vimeo";
|
|
24150
24150
|
})(VideoProvider || (VideoProvider = {}));
|
|
24151
24151
|
|
|
24152
|
-
const VideoContainer = styled__default.default.figure`
|
|
24152
|
+
const VideoContainer$1 = styled__default.default.figure`
|
|
24153
24153
|
display: block;
|
|
24154
24154
|
padding-top: 56.25%;
|
|
24155
24155
|
position: relative;
|
|
@@ -24209,7 +24209,7 @@ var Video = function (_a) {
|
|
|
24209
24209
|
React.useEffect(function () {
|
|
24210
24210
|
setNotServer(true);
|
|
24211
24211
|
}, []);
|
|
24212
|
-
return (React__default.default.createElement(React__default.default.Fragment, null, cookiesAccepted && notServer ? (React__default.default.createElement(VideoContainer, { "data-testid": "Video" },
|
|
24212
|
+
return (React__default.default.createElement(React__default.default.Fragment, null, cookiesAccepted && notServer ? (React__default.default.createElement(VideoContainer$1, { "data-testid": "Video" },
|
|
24213
24213
|
React__default.default.createElement("iframe", { src: embedLink, title: description, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen;", "data-testid": "VideoIframe" }))) : (React__default.default.createElement(VideoLink, { href: watchLink, title: description, "data-testid": "VideoLink" }, description))));
|
|
24214
24214
|
};
|
|
24215
24215
|
|
|
@@ -25786,14 +25786,43 @@ const Search = styled__default.default.div`
|
|
|
25786
25786
|
margin: ${(props) => props.theme.theme_vars.spacingSizes.medium} 0;
|
|
25787
25787
|
`;
|
|
25788
25788
|
|
|
25789
|
+
const VideoContainer = styled__default.default.div`
|
|
25790
|
+
width: 100%;
|
|
25791
|
+
`;
|
|
25792
|
+
|
|
25789
25793
|
const VideoBackground = styled__default.default.video`
|
|
25790
25794
|
position: absolute;
|
|
25791
25795
|
top: 0;
|
|
25792
25796
|
left: 0;
|
|
25793
25797
|
width: 100%;
|
|
25794
|
-
height:
|
|
25798
|
+
height: 575px;
|
|
25795
25799
|
object-fit: cover;
|
|
25796
25800
|
z-index: -1;
|
|
25801
|
+
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.l}) {
|
|
25802
|
+
height: 540px;
|
|
25803
|
+
}
|
|
25804
|
+
`;
|
|
25805
|
+
|
|
25806
|
+
const PlayPauseButton = styled__default.default.button`
|
|
25807
|
+
position: absolute;
|
|
25808
|
+
bottom: 40px;
|
|
25809
|
+
right: 40px;
|
|
25810
|
+
background: rgba(0, 0, 0, 0.5);
|
|
25811
|
+
border: 1px solid white;
|
|
25812
|
+
color: white;
|
|
25813
|
+
font-size: 32px;
|
|
25814
|
+
border-radius: 50%;
|
|
25815
|
+
width: 50px;
|
|
25816
|
+
height: 50px;
|
|
25817
|
+
cursor: pointer;
|
|
25818
|
+
display: flex;
|
|
25819
|
+
align-items: center;
|
|
25820
|
+
justify-content: center;
|
|
25821
|
+
z-index: 10;
|
|
25822
|
+
|
|
25823
|
+
&:hover {
|
|
25824
|
+
background: rgba(0, 0, 0, 0.7);
|
|
25825
|
+
}
|
|
25797
25826
|
`;
|
|
25798
25827
|
|
|
25799
25828
|
/**
|
|
@@ -25802,13 +25831,29 @@ const VideoBackground = styled__default.default.video`
|
|
|
25802
25831
|
*/
|
|
25803
25832
|
var HeroImage = function (_a) {
|
|
25804
25833
|
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;
|
|
25834
|
+
var _d = React.useState(true), isPlaying = _d[0], setIsPlaying = _d[1];
|
|
25835
|
+
var videoRef = React.useRef(null);
|
|
25836
|
+
var togglePlay = function () {
|
|
25837
|
+
if (videoRef.current) {
|
|
25838
|
+
if (isPlaying) {
|
|
25839
|
+
videoRef.current.pause();
|
|
25840
|
+
}
|
|
25841
|
+
else {
|
|
25842
|
+
videoRef.current.play();
|
|
25843
|
+
}
|
|
25844
|
+
setIsPlaying(!isPlaying);
|
|
25845
|
+
}
|
|
25846
|
+
};
|
|
25805
25847
|
return (React__default.default.createElement(React__default.default.Fragment, null,
|
|
25806
25848
|
React__default.default.createElement(LazyImage, { src: imageLarge, placeholder: imageSmall, visibilitySensorProps: {
|
|
25807
25849
|
partialVisibility: true,
|
|
25808
25850
|
} }, function (src) { return (React__default.default.createElement(Container$u, { "$image": src, "$backgroundBox": backgroundBox, "data-testid": "HeroImage" },
|
|
25809
|
-
heroVideoUrl && (React__default.default.createElement(
|
|
25810
|
-
React__default.default.createElement(
|
|
25811
|
-
|
|
25851
|
+
heroVideoUrl && (React__default.default.createElement(React__default.default.Fragment, null,
|
|
25852
|
+
React__default.default.createElement(VideoContainer, null,
|
|
25853
|
+
React__default.default.createElement(VideoBackground, { ref: videoRef, autoPlay: "false", loop: true, muted: true },
|
|
25854
|
+
React__default.default.createElement("source", { src: heroVideoUrl, type: "video/mp4" }),
|
|
25855
|
+
"Your browser doesn't support this video."),
|
|
25856
|
+
React__default.default.createElement(PlayPauseButton, { onClick: togglePlay }, isPlaying ? '⏸' : '▶')))),
|
|
25812
25857
|
React__default.default.createElement(InnerContainer, null,
|
|
25813
25858
|
React__default.default.createElement(Overlay, { "$backgroundBox": backgroundBox, "data-testid": "HeroImageOverlay" },
|
|
25814
25859
|
breadcrumb && (React__default.default.createElement(BreadcrumbLink, { href: breadcrumb.url, "$backgroundBox": backgroundBox }, breadcrumb.title)),
|