@digital-b2c/coreui-kit 0.14.1 → 0.14.3

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,6 +1,6 @@
1
1
  import clsx43 from 'clsx';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
- import React67, { forwardRef, useId, useRef, useState, useCallback, useMemo, useEffect, Children, isValidElement, Fragment as Fragment$1 } from 'react';
3
+ import React68, { 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';
@@ -381,7 +381,7 @@ var svgs = {
381
381
  xBlack: icon_x_black_default,
382
382
  xWhite: icon_x_white_default
383
383
  };
384
- var Icon = React67.memo(
384
+ var Icon = React68.memo(
385
385
  (_a) => {
386
386
  var _b = _a, { type, size } = _b, props = __objRest(_b, ["type", "size"]);
387
387
  if (type) {
@@ -1440,6 +1440,7 @@ var UpcomingEventCard_module_default = {
1440
1440
  "event-card-show-image": "UpcomingEventCard_module_event-card-show-image",
1441
1441
  "event-card-cta": "UpcomingEventCard_module_event-card-cta",
1442
1442
  hidden: "UpcomingEventCard_module_hidden",
1443
+ "event-card-cta-wrapper": "UpcomingEventCard_module_event-card-cta-wrapper",
1443
1444
  "cta-without-image": "UpcomingEventCard_module_cta-without-image",
1444
1445
  vertical: "UpcomingEventCard_module_vertical"
1445
1446
  };
@@ -1485,7 +1486,7 @@ var UpcomingEventCard = ({
1485
1486
  title && /* @__PURE__ */ jsx("h3", { className: clsx43("card-text-title"), children: title }),
1486
1487
  location && /* @__PURE__ */ jsx("span", { className: UpcomingEventCard_module_default.location, children: location }),
1487
1488
  description && /* @__PURE__ */ jsx("div", { className: clsx43("card-text-description", UpcomingEventCard_module_default.description), children: description }),
1488
- cta && cta.url && /* @__PURE__ */ jsx(
1489
+ cta && cta.url && /* @__PURE__ */ jsx("div", { className: clsx43("card-cta-wrapper", UpcomingEventCard_module_default["event-card-cta-wrapper"]), children: /* @__PURE__ */ jsx(
1489
1490
  Button,
1490
1491
  {
1491
1492
  variant: "secondary",
@@ -1500,7 +1501,7 @@ var UpcomingEventCard = ({
1500
1501
  isExternal: cta == null ? void 0 : cta.isExternal,
1501
1502
  children: cta.label
1502
1503
  }
1503
- )
1504
+ ) })
1504
1505
  ]
1505
1506
  }
1506
1507
  )
@@ -2723,7 +2724,7 @@ var MiniBanner = ({
2723
2724
  (logo == null ? void 0 : logo.src) && /* @__PURE__ */ jsx(Picture, __spreadValues({ className: MiniBanner_module_default.logo }, logo)),
2724
2725
  pretitleNode && /* @__PURE__ */ jsx("div", { className: clsx43(MiniBanner_module_default.pretitle, "small"), children: pretitleNode }),
2725
2726
  /* @__PURE__ */ jsxs("div", { className: MiniBanner_module_default.headingWrapper, children: [
2726
- goBackNode ? React67.cloneElement(goBackNode, {
2727
+ goBackNode ? React68.cloneElement(goBackNode, {
2727
2728
  className: clsx43("back-button", MiniBanner_module_default["back-button"])
2728
2729
  }) : null,
2729
2730
  titleNode && /* @__PURE__ */ jsx("div", { className: clsx43(MiniBanner_module_default.title, isMiniBannerTextLeft ? "h1" : "h4"), children: titleNode })
@@ -3489,11 +3490,15 @@ var EventList_module_default = {
3489
3490
  horizontal: "EventList_module_horizontal",
3490
3491
  "carousel-wrapper": "EventList_module_carousel-wrapper",
3491
3492
  "carousel-list-item": "EventList_module_carousel-list-item",
3492
- "event-card": "EventList_module_event-card"
3493
+ "event-card": "EventList_module_event-card",
3494
+ "empty-search-result": "EventList_module_empty-search-result"
3493
3495
  };
3494
3496
  var EventListTitle = ({ children }) => {
3495
3497
  return /* @__PURE__ */ jsx(Fragment, { children });
3496
3498
  };
3499
+ var EventListEmpty = ({ children }) => {
3500
+ return /* @__PURE__ */ jsx(Fragment, { children });
3501
+ };
3497
3502
  var EventList = ({
3498
3503
  className,
3499
3504
  title,
@@ -3506,13 +3511,16 @@ var EventList = ({
3506
3511
  var _a;
3507
3512
  const { is } = useViewPort_default();
3508
3513
  const slots = resolveCompoundSlots(children, {
3509
- title: EventListTitle
3514
+ title: EventListTitle,
3515
+ empty: EventListEmpty
3510
3516
  });
3511
3517
  const titleNode = (_a = slots.title) != null ? _a : title;
3518
+ const emptyNode = slots == null ? void 0 : slots.empty;
3512
3519
  const isBelowTablet = is("tablet", "below");
3513
3520
  const cardDirection = isBelowTablet ? "vertical" : "horizontal";
3514
3521
  const isInternalEventList = variant === "internalEventList";
3515
3522
  const listDirection = isInternalEventList ? "horizontal" : "vertical";
3523
+ const isNotEmpty = Boolean(items) && items.length > 0;
3516
3524
  return /* @__PURE__ */ jsx(
3517
3525
  "div",
3518
3526
  {
@@ -3535,63 +3543,72 @@ var EventList = ({
3535
3543
  }
3536
3544
  )
3537
3545
  ] }),
3538
- isInternalEventList && isBelowTablet && /* @__PURE__ */ jsx(
3539
- Carousel,
3540
- {
3541
- "aria-label": "Upcoming events",
3542
- wrapperClass: clsx43(EventList_module_default["carousel-wrapper"], EventList_module_default[variant]),
3543
- slideClass: EventList_module_default["carousel-list-item"],
3544
- spaceBetween: 16,
3545
- slides: items.map((item) => {
3546
- var _a2, _b;
3547
- return /* @__PURE__ */ jsx(
3548
- UpcomingEventCard,
3549
- __spreadValues({
3550
- className: clsx43(EventList_module_default["event-card"]),
3551
- direction: "vertical",
3552
- showImage: false
3553
- }, item),
3554
- (_b = (_a2 = item.title) != null ? _a2 : item.date) != null ? _b : item.location
3555
- );
3556
- })
3557
- }
3558
- ),
3559
- isInternalEventList && !isBelowTablet && /* @__PURE__ */ jsx(
3560
- "ul",
3561
- {
3562
- "aria-label": "Upcoming events",
3563
- className: clsx43(EventList_module_default["event-list-wrapper"], EventList_module_default["horizontal"], EventList_module_default[variant]),
3564
- children: items == null ? void 0 : items.map((item, index) => {
3565
- var _a2, _b, _c;
3566
- return /* @__PURE__ */ jsx(
3567
- "li",
3568
- {
3569
- className: clsx43(EventList_module_default["card-list-item"]),
3570
- children: /* @__PURE__ */ jsx(
3571
- UpcomingEventCard,
3572
- __spreadProps(__spreadValues({}, item), {
3573
- className: clsx43(EventList_module_default["card-item"]),
3574
- showImage: false,
3575
- direction: "vertical"
3576
- })
3577
- )
3578
- },
3579
- (_c = (_b = (_a2 = item.title) != null ? _a2 : item.date) != null ? _b : item.location) != null ? _c : index
3580
- );
3581
- })
3582
- }
3583
- ),
3584
- !isInternalEventList && /* @__PURE__ */ jsx(
3585
- "ul",
3586
- {
3587
- "aria-label": "Upcoming events",
3588
- className: clsx43(EventList_module_default["event-list-wrapper"], EventList_module_default[listDirection]),
3589
- children: items == null ? void 0 : items.map((item, index) => {
3590
- var _a2, _b, _c;
3591
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(UpcomingEventCard, __spreadProps(__spreadValues({}, item), { direction: cardDirection })) }, (_c = (_b = (_a2 = item.title) != null ? _a2 : item.date) != null ? _b : item.location) != null ? _c : index);
3592
- })
3593
- }
3594
- )
3546
+ isNotEmpty && /* @__PURE__ */ jsxs(Fragment, { children: [
3547
+ isInternalEventList && isBelowTablet && /* @__PURE__ */ jsx(
3548
+ Carousel,
3549
+ {
3550
+ "aria-label": "Upcoming events",
3551
+ wrapperClass: clsx43(EventList_module_default["carousel-wrapper"], EventList_module_default[variant]),
3552
+ slideClass: EventList_module_default["carousel-list-item"],
3553
+ spaceBetween: 16,
3554
+ slides: items.map((item) => {
3555
+ var _a2, _b;
3556
+ return /* @__PURE__ */ jsx(
3557
+ UpcomingEventCard,
3558
+ __spreadValues({
3559
+ className: clsx43(EventList_module_default["event-card"]),
3560
+ direction: "vertical",
3561
+ showImage: false
3562
+ }, item),
3563
+ (_b = (_a2 = item.title) != null ? _a2 : item.date) != null ? _b : item.location
3564
+ );
3565
+ })
3566
+ }
3567
+ ),
3568
+ isInternalEventList && !isBelowTablet && /* @__PURE__ */ jsx(
3569
+ "ul",
3570
+ {
3571
+ "aria-label": "Upcoming events",
3572
+ className: clsx43(
3573
+ EventList_module_default["event-list-wrapper"],
3574
+ EventList_module_default["horizontal"],
3575
+ EventList_module_default[variant]
3576
+ ),
3577
+ children: items == null ? void 0 : items.map((item, index) => {
3578
+ var _a2, _b, _c;
3579
+ return /* @__PURE__ */ jsx(
3580
+ "li",
3581
+ {
3582
+ className: clsx43(EventList_module_default["card-list-item"]),
3583
+ children: /* @__PURE__ */ jsx(
3584
+ UpcomingEventCard,
3585
+ __spreadProps(__spreadValues({}, item), {
3586
+ className: clsx43(EventList_module_default["card-item"]),
3587
+ showImage: false,
3588
+ direction: "vertical"
3589
+ })
3590
+ )
3591
+ },
3592
+ (_c = (_b = (_a2 = item.title) != null ? _a2 : item.date) != null ? _b : item.location) != null ? _c : index
3593
+ );
3594
+ })
3595
+ }
3596
+ ),
3597
+ !isInternalEventList && /* @__PURE__ */ jsx(
3598
+ "ul",
3599
+ {
3600
+ "aria-label": "Upcoming events",
3601
+ className: clsx43(EventList_module_default["event-list-wrapper"], EventList_module_default[listDirection]),
3602
+ children: items == null ? void 0 : items.map((item, index) => {
3603
+ var _a2, _b, _c;
3604
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(UpcomingEventCard, __spreadProps(__spreadValues({}, item), { direction: cardDirection })) }, (_c = (_b = (_a2 = item.title) != null ? _a2 : item.date) != null ? _b : item.location) != null ? _c : index);
3605
+ })
3606
+ }
3607
+ )
3608
+ ] }),
3609
+ !isNotEmpty && emptyNode ? React68.cloneElement(emptyNode, {
3610
+ className: clsx43("empty-search-result", EventList_module_default["empty-search-result"])
3611
+ }) : null
3595
3612
  ] })
3596
3613
  }
3597
3614
  );
@@ -3599,7 +3616,8 @@ var EventList = ({
3599
3616
 
3600
3617
  // src/widgets/EventList/index.ts
3601
3618
  var EventList2 = Object.assign(EventList, {
3602
- Title: EventListTitle
3619
+ Title: EventListTitle,
3620
+ Empty: EventListEmpty
3603
3621
  });
3604
3622
 
3605
3623
  // src/widgets/TextEvent/TextEvent.module.scss
@@ -4244,7 +4262,7 @@ var NewsCardList = ({
4244
4262
  /* @__PURE__ */ jsx(BlogCardGrid2, { items: cards, hasContainer: false, renderLink })
4245
4263
  ] })
4246
4264
  ] }),
4247
- paginationNode ? React67.cloneElement(paginationNode, {
4265
+ paginationNode ? React68.cloneElement(paginationNode, {
4248
4266
  className: clsx43("pagination", NewsCardList_module_default["pagination"])
4249
4267
  }) : null
4250
4268
  ] })
@@ -4360,7 +4378,7 @@ var BlogSearchResultsList = ({
4360
4378
  const searchNode = (_a = slots.search) != null ? _a : searchResult;
4361
4379
  const paginationNode = slots.pagination;
4362
4380
  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: [
4363
- typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) : React67.isValidElement(searchNode) ? React67.cloneElement(searchNode, {
4381
+ typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) : React68.isValidElement(searchNode) ? React68.cloneElement(searchNode, {
4364
4382
  className: clsx43("search-result", BlogSearchResultsList_module_default["search-result"])
4365
4383
  }) : null,
4366
4384
  /* @__PURE__ */ jsxs("div", { className: clsx43("wrapper", BlogSearchResultsList_module_default["wrapper"]), children: [
@@ -4388,7 +4406,7 @@ var BlogSearchResultsList = ({
4388
4406
  ),
4389
4407
  /* @__PURE__ */ jsx(BlogCardGrid2, { items, hasContainer: false, renderLink })
4390
4408
  ] }),
4391
- paginationNode ? React67.cloneElement(paginationNode, {
4409
+ paginationNode ? React68.cloneElement(paginationNode, {
4392
4410
  className: clsx43("pagination", BlogSearchResultsList_module_default["pagination"])
4393
4411
  }) : null
4394
4412
  ] }) });
@@ -4431,7 +4449,7 @@ var GlobalSearchResultsList = ({
4431
4449
  const searchNode = (_a = slots.search) != null ? _a : searchResult;
4432
4450
  const paginationNode = slots.pagination;
4433
4451
  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: [
4434
- typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", GlobalSearchResultsList_module_default["search-result"]), children: searchNode }) : React67.isValidElement(searchNode) ? React67.cloneElement(searchNode, {
4452
+ typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", GlobalSearchResultsList_module_default["search-result"]), children: searchNode }) : React68.isValidElement(searchNode) ? React68.cloneElement(searchNode, {
4435
4453
  className: clsx43("search-result", GlobalSearchResultsList_module_default["search-result"])
4436
4454
  }) : null,
4437
4455
  /* @__PURE__ */ jsx("div", { className: clsx43("wrapper", GlobalSearchResultsList_module_default["wrapper"]), children: /* @__PURE__ */ jsx(Grid, { role: "list", columns: 3, children: items.map((item, index) => {
@@ -4446,7 +4464,7 @@ var GlobalSearchResultsList = ({
4446
4464
  }
4447
4465
  ) }, (_a2 = item.title) != null ? _a2 : index);
4448
4466
  }) }) }),
4449
- paginationNode ? React67.cloneElement(paginationNode, {
4467
+ paginationNode ? React68.cloneElement(paginationNode, {
4450
4468
  className: clsx43("pagination", GlobalSearchResultsList_module_default["pagination"])
4451
4469
  }) : null
4452
4470
  ] }) });