@telia/teddy 0.7.33 → 0.7.34
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/dist/components/video/index.cjs +4 -0
- package/dist/components/video/index.d.ts +2 -0
- package/dist/components/video/index.js +4 -0
- package/dist/components/video/video.cjs +43 -0
- package/dist/components/video/video.d.ts +12 -0
- package/dist/components/video/video.js +44 -0
- package/dist/style.css +69 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const clsx = require("clsx");
|
|
4
|
+
require("../../assets/sprite.6511e521-teddy.svg");
|
|
5
|
+
const components_icon_icon = require("../icon/icon.cjs");
|
|
6
|
+
const video = "_video_e37ft_1";
|
|
7
|
+
const iframeWrapper = "_iframeWrapper_e37ft_5";
|
|
8
|
+
const iframe = "_iframe_e37ft_5";
|
|
9
|
+
const customDetails = "_customDetails_e37ft_24";
|
|
10
|
+
const thumbnail = "_thumbnail_e37ft_51";
|
|
11
|
+
const details = "_details_e37ft_57";
|
|
12
|
+
const icon = "_icon_e37ft_67";
|
|
13
|
+
const styles = {
|
|
14
|
+
video,
|
|
15
|
+
iframeWrapper,
|
|
16
|
+
iframe,
|
|
17
|
+
customDetails,
|
|
18
|
+
thumbnail,
|
|
19
|
+
details,
|
|
20
|
+
icon
|
|
21
|
+
};
|
|
22
|
+
const Video = ({ className, src, allowFullScreen, img, description, videoTitle, autoplay, ...rest }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx(img ? styles.withCustomThumbnail : styles.video, className), ...rest, children: [
|
|
23
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.iframeWrapper, children: [
|
|
24
|
+
img && !autoplay && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.customDetails, children: [
|
|
25
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: img, alt: "", className: styles.thumbnail }),
|
|
26
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.details, children: [
|
|
27
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { className: styles.icon, name: "play", color: "white" }),
|
|
28
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: styles.title, children: description })
|
|
29
|
+
] })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
"iframe",
|
|
33
|
+
{
|
|
34
|
+
src: src + (autoplay ? "?rel=0&autoplay=1" : ""),
|
|
35
|
+
className: styles.iframe,
|
|
36
|
+
allowFullScreen,
|
|
37
|
+
title: videoTitle
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] }),
|
|
41
|
+
!img && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.caption, children: description })
|
|
42
|
+
] });
|
|
43
|
+
module.exports = Video;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface VideoProps {
|
|
2
|
+
allowFullScreen?: boolean;
|
|
3
|
+
autoplay?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
img?: string;
|
|
7
|
+
src?: string;
|
|
8
|
+
videoTitle?: string;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const Video: ({ className, src, allowFullScreen, img, description, videoTitle, autoplay, ...rest }: VideoProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default Video;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import "../../assets/sprite.6511e521-teddy.svg";
|
|
4
|
+
import { Icon } from "../icon/icon.js";
|
|
5
|
+
const video = "_video_e37ft_1";
|
|
6
|
+
const iframeWrapper = "_iframeWrapper_e37ft_5";
|
|
7
|
+
const iframe = "_iframe_e37ft_5";
|
|
8
|
+
const customDetails = "_customDetails_e37ft_24";
|
|
9
|
+
const thumbnail = "_thumbnail_e37ft_51";
|
|
10
|
+
const details = "_details_e37ft_57";
|
|
11
|
+
const icon = "_icon_e37ft_67";
|
|
12
|
+
const styles = {
|
|
13
|
+
video,
|
|
14
|
+
iframeWrapper,
|
|
15
|
+
iframe,
|
|
16
|
+
customDetails,
|
|
17
|
+
thumbnail,
|
|
18
|
+
details,
|
|
19
|
+
icon
|
|
20
|
+
};
|
|
21
|
+
const Video = ({ className, src, allowFullScreen, img, description, videoTitle, autoplay, ...rest }) => /* @__PURE__ */ jsxs("div", { className: clsx(img ? styles.withCustomThumbnail : styles.video, className), ...rest, children: [
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: styles.iframeWrapper, children: [
|
|
23
|
+
img && !autoplay && /* @__PURE__ */ jsxs("div", { className: styles.customDetails, children: [
|
|
24
|
+
/* @__PURE__ */ jsx("img", { src: img, alt: "", className: styles.thumbnail }),
|
|
25
|
+
/* @__PURE__ */ jsxs("div", { className: styles.details, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Icon, { className: styles.icon, name: "play", color: "white" }),
|
|
27
|
+
/* @__PURE__ */ jsx("h2", { className: styles.title, children: description })
|
|
28
|
+
] })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
"iframe",
|
|
32
|
+
{
|
|
33
|
+
src: src + (autoplay ? "?rel=0&autoplay=1" : ""),
|
|
34
|
+
className: styles.iframe,
|
|
35
|
+
allowFullScreen,
|
|
36
|
+
title: videoTitle
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
] }),
|
|
40
|
+
!img && /* @__PURE__ */ jsx("div", { className: styles.caption, children: description })
|
|
41
|
+
] });
|
|
42
|
+
export {
|
|
43
|
+
Video as default
|
|
44
|
+
};
|
package/dist/style.css
CHANGED
|
@@ -7044,6 +7044,75 @@
|
|
|
7044
7044
|
margin: 0;
|
|
7045
7045
|
font-size: 14px;
|
|
7046
7046
|
font-weight: 400;
|
|
7047
|
+
}._video_e37ft_1 {
|
|
7048
|
+
margin-bottom: 2rem;
|
|
7049
|
+
}
|
|
7050
|
+
|
|
7051
|
+
._iframeWrapper_e37ft_5 {
|
|
7052
|
+
height: 0;
|
|
7053
|
+
padding-bottom: 56.25%; /* 16:9 */
|
|
7054
|
+
position: relative;
|
|
7055
|
+
}
|
|
7056
|
+
|
|
7057
|
+
._noMarginBottom_e37ft_11 {
|
|
7058
|
+
margin-bottom: 0;
|
|
7059
|
+
}
|
|
7060
|
+
|
|
7061
|
+
._iframe_e37ft_5 {
|
|
7062
|
+
border: none;
|
|
7063
|
+
height: 100%;
|
|
7064
|
+
left: 0;
|
|
7065
|
+
position: absolute;
|
|
7066
|
+
top: 0;
|
|
7067
|
+
width: 100%;
|
|
7068
|
+
}
|
|
7069
|
+
|
|
7070
|
+
._customDetails_e37ft_24 {
|
|
7071
|
+
position: absolute;
|
|
7072
|
+
top: 0;
|
|
7073
|
+
left: 0;
|
|
7074
|
+
width: 100%;
|
|
7075
|
+
height: 100%;
|
|
7076
|
+
cursor: pointer;
|
|
7077
|
+
z-index: 1;
|
|
7078
|
+
}
|
|
7079
|
+
._customDetails_e37ft_24._isHidden_e37ft_33 {
|
|
7080
|
+
display: none;
|
|
7081
|
+
}
|
|
7082
|
+
._customDetails_e37ft_24:hover:after {
|
|
7083
|
+
opacity: 0.65;
|
|
7084
|
+
}
|
|
7085
|
+
._customDetails_e37ft_24:after {
|
|
7086
|
+
content: "";
|
|
7087
|
+
background-color: var(--teddy-color-functional-black);
|
|
7088
|
+
position: absolute;
|
|
7089
|
+
top: 0;
|
|
7090
|
+
left: 0;
|
|
7091
|
+
width: 100%;
|
|
7092
|
+
height: 100%;
|
|
7093
|
+
opacity: 0.45;
|
|
7094
|
+
transition: opacity 0.25s ease-in;
|
|
7095
|
+
}
|
|
7096
|
+
|
|
7097
|
+
._thumbnail_e37ft_51 {
|
|
7098
|
+
width: 100%;
|
|
7099
|
+
height: 100%;
|
|
7100
|
+
object-fit: cover;
|
|
7101
|
+
}
|
|
7102
|
+
|
|
7103
|
+
._details_e37ft_57 {
|
|
7104
|
+
position: absolute;
|
|
7105
|
+
text-align: center;
|
|
7106
|
+
top: 57%;
|
|
7107
|
+
left: 50%;
|
|
7108
|
+
transform: translate(-50%, -50%);
|
|
7109
|
+
color: var(--teddy-color-functional-white);
|
|
7110
|
+
z-index: 1;
|
|
7111
|
+
}
|
|
7112
|
+
|
|
7113
|
+
._icon_e37ft_67 {
|
|
7114
|
+
width: 4rem;
|
|
7115
|
+
height: 4rem;
|
|
7047
7116
|
}:root {
|
|
7048
7117
|
--teddy-border-radius-xs: 2px;
|
|
7049
7118
|
--teddy-border-radius-sm: 4px;
|