@digital-b2c/coreui-kit 0.13.6 → 0.14.0

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.mjs CHANGED
@@ -1,12 +1,13 @@
1
1
  import clsx43 from 'clsx';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
- import React66, { forwardRef, useId, useRef, useState, useCallback, useMemo, Children, isValidElement, useEffect, Fragment as Fragment$1 } from 'react';
3
+ import React67, { forwardRef, useId, useRef, useState, useCallback, useMemo, useEffect, Children, isValidElement, Fragment as Fragment$1 } from 'react';
4
4
  import gsap$1, { gsap } from 'gsap';
5
5
  import { useGSAP } from '@gsap/react';
6
6
  import { ScrollTrigger } from 'gsap/ScrollTrigger';
7
7
  import { Swiper, SwiperSlide } from 'swiper/react';
8
8
  import { FreeMode, A11y, Navigation, Pagination as Pagination$1 } from 'swiper/modules';
9
9
  import 'swiper/css';
10
+ import ReactPlayer from 'react-player';
10
11
 
11
12
  var __defProp = Object.defineProperty;
12
13
  var __defProps = Object.defineProperties;
@@ -306,6 +307,11 @@ var SvgIconExternalLink = (props) => /* @__PURE__ */ jsxs("svg", __spreadProps(_
306
307
  /* @__PURE__ */ jsx("path", { d: "M19.4784 15.1242C18.8387 14.3348 18.0226 13.6816 17.0853 13.2089C16.1481 12.7363 15.1117 12.4552 14.0464 12.3848C12.9812 12.3143 11.912 12.4562 10.9113 12.8008C9.91068 13.1453 9.00202 13.6845 8.24697 14.3817L3.77822 18.5067C2.42152 19.8034 1.67081 21.54 1.68778 23.3426C1.70475 25.1452 2.48804 26.8695 3.86894 28.1442C5.24985 29.4189 7.11788 30.1419 9.0707 30.1576C11.0235 30.1733 12.9049 29.4803 14.3096 28.228L16.8568 25.8767", stroke: "#949494", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" })
307
308
  ] }));
308
309
  var icon_external_link_default = SvgIconExternalLink;
310
+ var SvgIconPlay = (props) => /* @__PURE__ */ jsxs("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: 134, height: 134, viewBox: "0 0 134 134", fill: "none" }, props), { children: [
311
+ /* @__PURE__ */ jsx("rect", { x: 38, y: 40, width: 58, height: 53, fill: "white" }),
312
+ /* @__PURE__ */ jsx("path", { d: "M53.4617 90.7285L90.7305 66.9993L53.4617 43.2702V90.7285ZM67.0013 122.833C59.3707 122.833 52.1589 121.367 45.3659 118.436C38.5728 115.505 32.6405 111.503 27.569 106.432C22.4975 101.36 18.4961 95.4278 15.5648 88.6348C12.6336 81.8417 11.168 74.6299 11.168 66.9993C11.168 59.2757 12.6336 52.0174 15.5648 45.2243C18.4961 38.4313 22.4975 32.5223 27.569 27.4973C32.6405 22.4723 38.5728 18.4941 45.3659 15.5629C52.1589 12.6316 59.3707 11.166 67.0013 11.166C74.7249 11.166 81.9833 12.6316 88.7763 15.5629C95.5694 18.4941 101.478 22.4723 106.503 27.4973C111.528 32.5223 115.507 38.4313 118.438 45.2243C121.369 52.0174 122.835 59.2757 122.835 66.9993C122.835 74.6299 121.369 81.8417 118.438 88.6348C115.507 95.4278 111.528 101.36 106.503 106.432C101.478 111.503 95.5694 115.505 88.7763 118.436C81.9833 121.367 74.7249 122.833 67.0013 122.833Z", fill: "#080808" })
313
+ ] }));
314
+ var icon_play_default = SvgIconPlay;
309
315
  var svgs = {
310
316
  /* Card */
311
317
  ads: icon_ads_default,
@@ -329,6 +335,7 @@ var svgs = {
329
335
  pdf: icon_pdf_default,
330
336
  externalLink: icon_external_link_default,
331
337
  newIcon: icon_new_default,
338
+ play: icon_play_default,
332
339
  /* Button */
333
340
  blankCheckbox: icon_blank_checkbox_default,
334
341
  blankCheckboxWhite: icon_blank_checkbox_white_default,
@@ -374,7 +381,7 @@ var svgs = {
374
381
  xBlack: icon_x_black_default,
375
382
  xWhite: icon_x_white_default
376
383
  };
377
- var Icon = React66.memo(
384
+ var Icon = React67.memo(
378
385
  (_a) => {
379
386
  var _b = _a, { type, size } = _b, props = __objRest(_b, ["type", "size"]);
380
387
  if (type) {
@@ -2674,7 +2681,8 @@ var MiniBanner_module_default = {
2674
2681
  title: "MiniBanner_module_title",
2675
2682
  ctaContainer: "MiniBanner_module_ctaContainer",
2676
2683
  miniBannerNoBG: "MiniBanner_module_miniBannerNoBG",
2677
- miniBannerTextLeft: "MiniBanner_module_miniBannerTextLeft"
2684
+ miniBannerTextLeft: "MiniBanner_module_miniBannerTextLeft",
2685
+ container: "MiniBanner_module_container"
2678
2686
  };
2679
2687
  var MiniBannerPreTitle = ({ children }) => {
2680
2688
  return /* @__PURE__ */ jsx(Fragment, { children });
@@ -2710,12 +2718,12 @@ var MiniBanner = ({
2710
2718
  const goBackNode = slots == null ? void 0 : slots.goBack;
2711
2719
  return /* @__PURE__ */ jsxs("div", { className: clsx43(MiniBanner_module_default.minibanner, MiniBanner_module_default[variant], className), children: [
2712
2720
  ((background == null ? void 0 : background.src) || ((_d = background == null ? void 0 : background.desktop) == null ? void 0 : _d.src) || ((_e = background == null ? void 0 : background.mobile) == null ? void 0 : _e.src)) && /* @__PURE__ */ jsx(Picture, __spreadValues({ className: MiniBanner_module_default.background }, background)),
2713
- /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsxs("div", { className: MiniBanner_module_default.wrapper, children: [
2721
+ /* @__PURE__ */ jsx(Container, { className: clsx43(goBackNode && MiniBanner_module_default.container), children: /* @__PURE__ */ jsxs("div", { className: MiniBanner_module_default.wrapper, children: [
2714
2722
  /* @__PURE__ */ jsxs("div", { className: MiniBanner_module_default.textContainer, children: [
2715
2723
  (logo == null ? void 0 : logo.src) && /* @__PURE__ */ jsx(Picture, __spreadValues({ className: MiniBanner_module_default.logo }, logo)),
2716
2724
  pretitleNode && /* @__PURE__ */ jsx("div", { className: clsx43(MiniBanner_module_default.pretitle, "small"), children: pretitleNode }),
2717
2725
  /* @__PURE__ */ jsxs("div", { className: MiniBanner_module_default.headingWrapper, children: [
2718
- goBackNode ? React66.cloneElement(goBackNode, {
2726
+ goBackNode ? React67.cloneElement(goBackNode, {
2719
2727
  className: clsx43("back-button", MiniBanner_module_default["back-button"])
2720
2728
  }) : null,
2721
2729
  titleNode && /* @__PURE__ */ jsx("div", { className: clsx43(MiniBanner_module_default.title, isMiniBannerTextLeft ? "h1" : "h4"), children: titleNode })
@@ -4236,7 +4244,7 @@ var NewsCardList = ({
4236
4244
  /* @__PURE__ */ jsx(BlogCardGrid2, { items: cards, hasContainer: false, renderLink })
4237
4245
  ] })
4238
4246
  ] }),
4239
- paginationNode ? React66.cloneElement(paginationNode, {
4247
+ paginationNode ? React67.cloneElement(paginationNode, {
4240
4248
  className: clsx43("pagination", NewsCardList_module_default["pagination"])
4241
4249
  }) : null
4242
4250
  ] })
@@ -4352,7 +4360,7 @@ var BlogSearchResultsList = ({
4352
4360
  const searchNode = (_a = slots.search) != null ? _a : searchResult;
4353
4361
  const paginationNode = slots.pagination;
4354
4362
  return /* @__PURE__ */ jsx("div", { className: clsx43("search-results-list", BlogSearchResultsList_module_default["search-results-list"], className), children: /* @__PURE__ */ jsxs(Container, { className: clsx43("container", BlogSearchResultsList_module_default["container"]), children: [
4355
- typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) : React66.isValidElement(searchNode) ? React66.cloneElement(searchNode, {
4363
+ typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) : React67.isValidElement(searchNode) ? React67.cloneElement(searchNode, {
4356
4364
  className: clsx43("search-result", BlogSearchResultsList_module_default["search-result"])
4357
4365
  }) : null,
4358
4366
  /* @__PURE__ */ jsxs("div", { className: clsx43("wrapper", BlogSearchResultsList_module_default["wrapper"]), children: [
@@ -4380,7 +4388,7 @@ var BlogSearchResultsList = ({
4380
4388
  ),
4381
4389
  /* @__PURE__ */ jsx(BlogCardGrid2, { items, hasContainer: false, renderLink })
4382
4390
  ] }),
4383
- paginationNode ? React66.cloneElement(paginationNode, {
4391
+ paginationNode ? React67.cloneElement(paginationNode, {
4384
4392
  className: clsx43("pagination", BlogSearchResultsList_module_default["pagination"])
4385
4393
  }) : null
4386
4394
  ] }) });
@@ -4423,7 +4431,7 @@ var GlobalSearchResultsList = ({
4423
4431
  const searchNode = (_a = slots.search) != null ? _a : searchResult;
4424
4432
  const paginationNode = slots.pagination;
4425
4433
  return /* @__PURE__ */ jsx("div", { className: clsx43("search-results-list", GlobalSearchResultsList_module_default["search-results-list"], className), children: /* @__PURE__ */ jsxs(Container, { className: clsx43("container", GlobalSearchResultsList_module_default["container"]), children: [
4426
- typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", GlobalSearchResultsList_module_default["search-result"]), children: searchNode }) : React66.isValidElement(searchNode) ? React66.cloneElement(searchNode, {
4434
+ typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", GlobalSearchResultsList_module_default["search-result"]), children: searchNode }) : React67.isValidElement(searchNode) ? React67.cloneElement(searchNode, {
4427
4435
  className: clsx43("search-result", GlobalSearchResultsList_module_default["search-result"])
4428
4436
  }) : null,
4429
4437
  /* @__PURE__ */ jsx("div", { className: clsx43("wrapper", GlobalSearchResultsList_module_default["wrapper"]), children: /* @__PURE__ */ jsx(Grid, { role: "list", columns: 3, children: items.map((item, index) => {
@@ -4438,7 +4446,7 @@ var GlobalSearchResultsList = ({
4438
4446
  }
4439
4447
  ) }, (_a2 = item.title) != null ? _a2 : index);
4440
4448
  }) }) }),
4441
- paginationNode ? React66.cloneElement(paginationNode, {
4449
+ paginationNode ? React67.cloneElement(paginationNode, {
4442
4450
  className: clsx43("pagination", GlobalSearchResultsList_module_default["pagination"])
4443
4451
  }) : null
4444
4452
  ] }) });
@@ -4450,6 +4458,94 @@ var GlobalSearchResultsList2 = Object.assign(GlobalSearchResultsList, {
4450
4458
  Pagination: GlobalSearchResultsListPagination
4451
4459
  });
4452
4460
 
4453
- export { Anchor, Badge, BlogCardGrid2 as BlogCardGrid, BlogPost2 as BlogPost, BlogPostContent2 as BlogPostContent, BlogSearchResultsList2 as BlogSearchResultsList, BrandsStrip, Button, Card2 as Card, CardCollection2 as CardCollection, ConditionalWrapper, ContactModule2 as ContactModule, Container, CountingCard2 as CountingCard, EventList2 as EventList, FeaturedNewsHighlights2 as FeaturedNewsHighlights, FilterBar, Footer, GlobalSearchResultsList2 as GlobalSearchResultsList, HeroBanner2 as HeroBanner, HeroBannerCarousel, Icon, InfoCard2 as InfoCard, Input, InternalBrandsTab2 as InternalBrandsTab, MiniBanner2 as MiniBanner, MiniSectionCta2 as MiniSectionCta, Navigation2 as Navigation, NewsCard, NewsCardList2 as NewsCardList, Pagination, Picture, PracticeCard, PracticePathCards2 as PracticePathCards, ResourceCardItem, ResourcesGridList, Sidebar, Teaser5050With3Text2 as Teaser5050With3Text, Teaser5050WithCta2 as Teaser5050WithCta, TextBody2 as TextBody, TextCenterCtaInBottom2 as TextCenterCtaInBottom, TextEvent2 as TextEvent, UpcomingEventCard, resolveCompoundSlots, svgs, useIntersectionObserver, useIsAtTop };
4461
+ // src/widgets/TextCenterWithMedia/TextCenterWithMedia.module.scss
4462
+ var TextCenterWithMedia_module_default = {
4463
+ textCenterWithMedia: "TextCenterWithMedia_module_textCenterWithMedia",
4464
+ thumbnailWrapper: "TextCenterWithMedia_module_thumbnailWrapper",
4465
+ thumbnail: "TextCenterWithMedia_module_thumbnail",
4466
+ playButton: "TextCenterWithMedia_module_playButton",
4467
+ modal: "TextCenterWithMedia_module_modal",
4468
+ modalInner: "TextCenterWithMedia_module_modalInner",
4469
+ modalHeader: "TextCenterWithMedia_module_modalHeader",
4470
+ closeButton: "TextCenterWithMedia_module_closeButton",
4471
+ video: "TextCenterWithMedia_module_video"
4472
+ };
4473
+ var TextCenterWithMediaTitle = ({ children }) => {
4474
+ return /* @__PURE__ */ jsx(Fragment, { children });
4475
+ };
4476
+ var TextCenterWithMedia = ({
4477
+ className,
4478
+ title,
4479
+ thumbnail,
4480
+ videoUrl,
4481
+ loop = false,
4482
+ mute = false,
4483
+ hideControl = false,
4484
+ autoPlay = false,
4485
+ children
4486
+ }) => {
4487
+ var _a;
4488
+ const [isOpen, setIsOpen] = useState(false);
4489
+ const dialogRef = useRef(null);
4490
+ const videoRef = useRef(null);
4491
+ useEffect(() => {
4492
+ var _a2, _b;
4493
+ if (isOpen) {
4494
+ (_a2 = dialogRef.current) == null ? void 0 : _a2.showModal();
4495
+ } else {
4496
+ (_b = dialogRef.current) == null ? void 0 : _b.close();
4497
+ }
4498
+ }, [isOpen]);
4499
+ const handleClose = () => {
4500
+ if (videoRef.current) {
4501
+ videoRef.current.pause();
4502
+ videoRef.current.currentTime = 0;
4503
+ }
4504
+ setIsOpen(false);
4505
+ };
4506
+ const slots = resolveCompoundSlots(children, { title: TextCenterWithMediaTitle });
4507
+ const titleNode = (_a = slots.title) != null ? _a : title;
4508
+ return /* @__PURE__ */ jsxs("section", { className: clsx43(TextCenterWithMedia_module_default.textCenterWithMedia, className), children: [
4509
+ /* @__PURE__ */ jsxs(Container, { children: [
4510
+ titleNode && /* @__PURE__ */ jsx("h2", { className: "h2", children: titleNode }),
4511
+ /* @__PURE__ */ jsx("div", { className: TextCenterWithMedia_module_default.thumbnailWrapper, children: thumbnail && /* @__PURE__ */ jsxs(Fragment, { children: [
4512
+ /* @__PURE__ */ jsx(Picture, { src: thumbnail, alt: "Video thumbnail", className: TextCenterWithMedia_module_default.thumbnail }),
4513
+ /* @__PURE__ */ jsx(
4514
+ "button",
4515
+ {
4516
+ className: TextCenterWithMedia_module_default.playButton,
4517
+ onClick: () => setIsOpen(true),
4518
+ "aria-label": "Play video",
4519
+ children: /* @__PURE__ */ jsx(Icon, { type: "play", size: 90 })
4520
+ }
4521
+ )
4522
+ ] }) })
4523
+ ] }),
4524
+ /* @__PURE__ */ jsx("dialog", { ref: dialogRef, className: TextCenterWithMedia_module_default.modal, onClose: handleClose, children: /* @__PURE__ */ jsxs("div", { className: TextCenterWithMedia_module_default.modalInner, children: [
4525
+ /* @__PURE__ */ jsx("div", { className: TextCenterWithMedia_module_default.modalHeader, children: /* @__PURE__ */ jsx("button", { className: TextCenterWithMedia_module_default.closeButton, onClick: handleClose, "aria-label": "Close video", children: /* @__PURE__ */ jsx(Icon, { type: "xBlack", size: 30 }) }) }),
4526
+ videoUrl && isOpen && /* @__PURE__ */ jsx(
4527
+ ReactPlayer,
4528
+ {
4529
+ ref: videoRef,
4530
+ src: videoUrl,
4531
+ playing: autoPlay,
4532
+ loop,
4533
+ muted: mute,
4534
+ controls: !hideControl,
4535
+ className: TextCenterWithMedia_module_default.video,
4536
+ width: "100%",
4537
+ height: "100%"
4538
+ }
4539
+ )
4540
+ ] }) })
4541
+ ] });
4542
+ };
4543
+
4544
+ // src/widgets/TextCenterWithMedia/index.ts
4545
+ var TextCenterWithMedia2 = Object.assign(TextCenterWithMedia, {
4546
+ Title: TextCenterWithMediaTitle
4547
+ });
4548
+
4549
+ export { Anchor, Badge, BlogCardGrid2 as BlogCardGrid, BlogPost2 as BlogPost, BlogPostContent2 as BlogPostContent, BlogSearchResultsList2 as BlogSearchResultsList, BrandsStrip, Button, Card2 as Card, CardCollection2 as CardCollection, ConditionalWrapper, ContactModule2 as ContactModule, Container, CountingCard2 as CountingCard, EventList2 as EventList, FeaturedNewsHighlights2 as FeaturedNewsHighlights, FilterBar, Footer, GlobalSearchResultsList2 as GlobalSearchResultsList, HeroBanner2 as HeroBanner, HeroBannerCarousel, Icon, InfoCard2 as InfoCard, Input, InternalBrandsTab2 as InternalBrandsTab, MiniBanner2 as MiniBanner, MiniSectionCta2 as MiniSectionCta, Navigation2 as Navigation, NewsCard, NewsCardList2 as NewsCardList, Pagination, Picture, PracticeCard, PracticePathCards2 as PracticePathCards, ResourceCardItem, ResourcesGridList, Sidebar, Teaser5050With3Text2 as Teaser5050With3Text, Teaser5050WithCta2 as Teaser5050WithCta, TextBody2 as TextBody, TextCenterCtaInBottom2 as TextCenterCtaInBottom, TextCenterWithMedia2 as TextCenterWithMedia, TextEvent2 as TextEvent, UpcomingEventCard, resolveCompoundSlots, svgs, useIntersectionObserver, useIsAtTop };
4454
4550
  //# sourceMappingURL=index.mjs.map
4455
4551
  //# sourceMappingURL=index.mjs.map