@digital-b2c/coreui-kit 0.29.3 → 0.29.5
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/index.cjs +33 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +16 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +115 -114
- package/dist/index.d.ts +115 -114
- package/dist/index.mjs +32 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -11
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { ScrollTrigger } from 'gsap/ScrollTrigger';
|
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
9
9
|
import { A11y, FreeMode, Navigation, Pagination as Pagination$1 } from 'swiper/modules';
|
|
10
|
-
import
|
|
10
|
+
import ReactPlayer2 from 'react-player';
|
|
11
11
|
import 'swiper/css';
|
|
12
12
|
|
|
13
13
|
var __defProp = Object.defineProperty;
|
|
@@ -2784,7 +2784,7 @@ var CardCarousel = ({
|
|
|
2784
2784
|
ariaLabel: "Video player",
|
|
2785
2785
|
closeLabel: "Close video",
|
|
2786
2786
|
children: activeVideo && /* @__PURE__ */ jsx(
|
|
2787
|
-
|
|
2787
|
+
ReactPlayer2,
|
|
2788
2788
|
{
|
|
2789
2789
|
src: activeVideo,
|
|
2790
2790
|
playing: true,
|
|
@@ -3016,6 +3016,7 @@ var ContactModule = ({
|
|
|
3016
3016
|
href: cta.url,
|
|
3017
3017
|
isExternal: cta.isExternal,
|
|
3018
3018
|
variant: ctas.length === 1 || key % 2 === 1 ? "primary" : "secondary",
|
|
3019
|
+
logo: cta.logo,
|
|
3019
3020
|
children: cta.label
|
|
3020
3021
|
},
|
|
3021
3022
|
key
|
|
@@ -6038,11 +6039,14 @@ var TextCenterWithMedia_module_default = {
|
|
|
6038
6039
|
thumbnailWrapper: "TextCenterWithMedia_module_thumbnailWrapper",
|
|
6039
6040
|
thumbnail: "TextCenterWithMedia_module_thumbnail",
|
|
6040
6041
|
playButton: "TextCenterWithMedia_module_playButton",
|
|
6041
|
-
video: "TextCenterWithMedia_module_video"
|
|
6042
|
+
video: "TextCenterWithMedia_module_video",
|
|
6043
|
+
videoPreview: "TextCenterWithMedia_module_videoPreview",
|
|
6044
|
+
videoPreviewElement: "TextCenterWithMedia_module_videoPreviewElement"
|
|
6042
6045
|
};
|
|
6043
6046
|
var TextCenterWithMediaTitle = ({ children }) => {
|
|
6044
6047
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
6045
6048
|
};
|
|
6049
|
+
var DIRECT_FILE_PATTERN = /\.(mp4|webm|ogg|ogv|mov|m4v)(\?.*)?$/i;
|
|
6046
6050
|
var TextCenterWithMedia = ({
|
|
6047
6051
|
className,
|
|
6048
6052
|
title,
|
|
@@ -6066,10 +6070,11 @@ var TextCenterWithMedia = ({
|
|
|
6066
6070
|
};
|
|
6067
6071
|
const slots = resolveCompoundSlots(children, { title: TextCenterWithMediaTitle });
|
|
6068
6072
|
const titleNode = (_a = slots.title) != null ? _a : title;
|
|
6073
|
+
const isDirectFile = !!videoUrl && DIRECT_FILE_PATTERN.test(videoUrl);
|
|
6069
6074
|
return /* @__PURE__ */ jsxs("section", { className: clsx72(TextCenterWithMedia_module_default.textCenterWithMedia, className), children: [
|
|
6070
6075
|
/* @__PURE__ */ jsxs(Container, { children: [
|
|
6071
6076
|
titleNode && /* @__PURE__ */ jsx("h2", { className: "h2", children: titleNode }),
|
|
6072
|
-
/* @__PURE__ */ jsx("div", { className: TextCenterWithMedia_module_default.thumbnailWrapper, children: thumbnail
|
|
6077
|
+
/* @__PURE__ */ jsx("div", { className: TextCenterWithMedia_module_default.thumbnailWrapper, children: thumbnail ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6073
6078
|
/* @__PURE__ */ jsx(Picture, { src: thumbnail, alt: "Video thumbnail", className: TextCenterWithMedia_module_default.thumbnail }),
|
|
6074
6079
|
/* @__PURE__ */ jsx(
|
|
6075
6080
|
"button",
|
|
@@ -6080,6 +6085,28 @@ var TextCenterWithMedia = ({
|
|
|
6080
6085
|
children: /* @__PURE__ */ jsx(Icon, { type: "play", size: 90 })
|
|
6081
6086
|
}
|
|
6082
6087
|
)
|
|
6088
|
+
] }) : videoUrl && /* @__PURE__ */ jsxs("div", { className: TextCenterWithMedia_module_default.videoPreview, children: [
|
|
6089
|
+
isDirectFile ? /* @__PURE__ */ jsx(
|
|
6090
|
+
"video",
|
|
6091
|
+
{
|
|
6092
|
+
src: videoUrl,
|
|
6093
|
+
preload: "metadata",
|
|
6094
|
+
muted: true,
|
|
6095
|
+
playsInline: true,
|
|
6096
|
+
tabIndex: -1,
|
|
6097
|
+
"aria-hidden": "true",
|
|
6098
|
+
className: TextCenterWithMedia_module_default.videoPreviewElement
|
|
6099
|
+
}
|
|
6100
|
+
) : /* @__PURE__ */ jsx(ReactPlayer2, { src: videoUrl, light: true, playing: false, width: "100%", height: "100%" }),
|
|
6101
|
+
/* @__PURE__ */ jsx(
|
|
6102
|
+
"button",
|
|
6103
|
+
{
|
|
6104
|
+
className: TextCenterWithMedia_module_default.playButton,
|
|
6105
|
+
onClick: () => setIsOpen(true),
|
|
6106
|
+
"aria-label": "Play video",
|
|
6107
|
+
children: /* @__PURE__ */ jsx(Icon, { type: "play", size: 90 })
|
|
6108
|
+
}
|
|
6109
|
+
)
|
|
6083
6110
|
] }) })
|
|
6084
6111
|
] }),
|
|
6085
6112
|
/* @__PURE__ */ jsx(
|
|
@@ -6090,7 +6117,7 @@ var TextCenterWithMedia = ({
|
|
|
6090
6117
|
ariaLabel: "Video player",
|
|
6091
6118
|
closeLabel: "Close video",
|
|
6092
6119
|
children: videoUrl && isOpen && /* @__PURE__ */ jsx(
|
|
6093
|
-
|
|
6120
|
+
ReactPlayer2,
|
|
6094
6121
|
{
|
|
6095
6122
|
ref: videoRef,
|
|
6096
6123
|
src: videoUrl,
|