@telia/teddy 0.7.32 → 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.
@@ -32,18 +32,14 @@ const DatePickerDay = ({
32
32
  }
33
33
  }, [isFocused, buttonRef]);
34
34
  let dayClass = components_datePicker_css.css("__day");
35
- if (isDisabled) {
36
- dayClass += " " + components_datePicker_css.css("is-disabled");
37
- } else {
38
- if (isToday) {
39
- dayClass += " " + components_datePicker_css.css("is-today");
40
- }
41
- if (isMonth) {
42
- dayClass += " " + components_datePicker_css.css("is-month");
43
- }
44
- if (isFocused) {
45
- dayClass += " " + components_datePicker_css.css("is-focused");
46
- }
35
+ if (isToday) {
36
+ dayClass += " " + components_datePicker_css.css("is-today");
37
+ }
38
+ if (isMonth) {
39
+ dayClass += " " + components_datePicker_css.css("is-month");
40
+ }
41
+ if (isFocused) {
42
+ dayClass += " " + components_datePicker_css.css("is-focused");
47
43
  }
48
44
  return /* @__PURE__ */ jsxRuntime.jsxs(
49
45
  "button",
@@ -30,18 +30,14 @@ const DatePickerDay = ({
30
30
  }
31
31
  }, [isFocused, buttonRef]);
32
32
  let dayClass = css("__day");
33
- if (isDisabled) {
34
- dayClass += " " + css("is-disabled");
35
- } else {
36
- if (isToday) {
37
- dayClass += " " + css("is-today");
38
- }
39
- if (isMonth) {
40
- dayClass += " " + css("is-month");
41
- }
42
- if (isFocused) {
43
- dayClass += " " + css("is-focused");
44
- }
33
+ if (isToday) {
34
+ dayClass += " " + css("is-today");
35
+ }
36
+ if (isMonth) {
37
+ dayClass += " " + css("is-month");
38
+ }
39
+ if (isFocused) {
40
+ dayClass += " " + css("is-focused");
45
41
  }
46
42
  return /* @__PURE__ */ jsxs(
47
43
  "button",
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const components_video_video = require("./video.cjs");
4
+ exports.Video = components_video_video;
@@ -0,0 +1,2 @@
1
+ export type { VideoProps } from './video';
2
+ export { default as Video } from './video';
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./video.js";
2
+ export {
3
+ default2 as Video
4
+ };
@@ -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;
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "pnpm": ">=10"
21
21
  },
22
22
  "private": false,
23
- "version": "0.7.32",
23
+ "version": "0.7.34",
24
24
  "sideEffects": [
25
25
  "**/*.css",
26
26
  "**/*.svg"