@digital-b2c/coreui-kit 0.7.2 → 0.7.4

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.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ImgHTMLAttributes, ReactNode, Ref, AnchorHTMLAttributes, HTMLAttributes, FC, PropsWithChildren } from 'react';
3
+ import React__default, { ImgHTMLAttributes, ReactNode, Ref, AnchorHTMLAttributes, HTMLAttributes, FC, PropsWithChildren, CSSProperties } from 'react';
4
4
 
5
5
  interface IPicture {
6
6
  src: string;
@@ -473,18 +473,18 @@ interface UpcomingEventCardProps {
473
473
  showImage?: boolean;
474
474
  }
475
475
 
476
- type EventListVariants = 'grey';
477
476
  interface EventListProps extends PropsWithChildren {
478
477
  className?: string;
479
- variant?: EventListVariants;
480
478
  title?: ReactNode;
481
479
  items: UpcomingEventCardProps[];
482
480
  cta?: ICta & {
483
481
  icon?: IconType;
484
482
  };
483
+ backgroundColor?: CSSProperties['backgroundColor'];
484
+ variant?: 'internalEventList';
485
485
  }
486
486
 
487
- declare const EventList: (({ className, title, items, cta, variant, children }: EventListProps) => react_jsx_runtime.JSX.Element) & {
487
+ declare const EventList: (({ className, title, items, cta, backgroundColor, variant, children, }: EventListProps) => react_jsx_runtime.JSX.Element) & {
488
488
  Title: ({ children }: EventListTitleProps) => react_jsx_runtime.JSX.Element;
489
489
  };
490
490
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ImgHTMLAttributes, ReactNode, Ref, AnchorHTMLAttributes, HTMLAttributes, FC, PropsWithChildren } from 'react';
3
+ import React__default, { ImgHTMLAttributes, ReactNode, Ref, AnchorHTMLAttributes, HTMLAttributes, FC, PropsWithChildren, CSSProperties } from 'react';
4
4
 
5
5
  interface IPicture {
6
6
  src: string;
@@ -473,18 +473,18 @@ interface UpcomingEventCardProps {
473
473
  showImage?: boolean;
474
474
  }
475
475
 
476
- type EventListVariants = 'grey';
477
476
  interface EventListProps extends PropsWithChildren {
478
477
  className?: string;
479
- variant?: EventListVariants;
480
478
  title?: ReactNode;
481
479
  items: UpcomingEventCardProps[];
482
480
  cta?: ICta & {
483
481
  icon?: IconType;
484
482
  };
483
+ backgroundColor?: CSSProperties['backgroundColor'];
484
+ variant?: 'internalEventList';
485
485
  }
486
486
 
487
- declare const EventList: (({ className, title, items, cta, variant, children }: EventListProps) => react_jsx_runtime.JSX.Element) & {
487
+ declare const EventList: (({ className, title, items, cta, backgroundColor, variant, children, }: EventListProps) => react_jsx_runtime.JSX.Element) & {
488
488
  Title: ({ children }: EventListTitleProps) => react_jsx_runtime.JSX.Element;
489
489
  };
490
490
 
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ 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
- import { FreeMode, Navigation, Pagination as Pagination$1 } from 'swiper/modules';
8
+ import { FreeMode, A11y, Navigation, Pagination as Pagination$1 } from 'swiper/modules';
9
9
  import 'swiper/css';
10
10
 
11
11
  var __defProp = Object.defineProperty;
@@ -389,7 +389,8 @@ var Button = (_a) => {
389
389
  }, isLink ? { href, isExternal } : {}), rest);
390
390
  return /* @__PURE__ */ jsxs(ConditionalWrapper, __spreadProps(__spreadValues({ wrapper: Anchor, fallback: "button", condition: isLink }, props), { children: [
391
391
  children,
392
- logo ? /* @__PURE__ */ jsx(Picture, __spreadValues({ className: Button_module_default.logo }, logo)) : icon && /* @__PURE__ */ jsx(Icon, { type: icon, className: Button_module_default.icon })
392
+ isExternal && /* @__PURE__ */ jsx("span", { className: "sr-only", children: "(opens in a new tab)" }),
393
+ logo ? /* @__PURE__ */ jsx(Picture, __spreadValues({ className: Button_module_default.logo }, logo)) : icon && /* @__PURE__ */ jsx(Icon, { type: icon, className: Button_module_default.icon, "aria-hidden": "true" })
393
394
  ] }));
394
395
  };
395
396
 
@@ -1768,6 +1769,7 @@ var UpcomingEventCard_module_default = {
1768
1769
  description: "UpcomingEventCard_module_description",
1769
1770
  "event-card-footer": "UpcomingEventCard_module_event-card-footer",
1770
1771
  horizontal: "UpcomingEventCard_module_horizontal",
1772
+ "event-card-show-image": "UpcomingEventCard_module_event-card-show-image",
1771
1773
  "event-card-cta": "UpcomingEventCard_module_event-card-cta",
1772
1774
  hidden: "UpcomingEventCard_module_hidden",
1773
1775
  "cta-without-image": "UpcomingEventCard_module_cta-without-image",
@@ -1802,27 +1804,38 @@ var UpcomingEventCard = ({
1802
1804
  children: [
1803
1805
  /* @__PURE__ */ jsxs("div", { className: clsx20("card-content", UpcomingEventCard_module_default["event-card-content"]), children: [
1804
1806
  showImage && image && /* @__PURE__ */ jsx(Picture, __spreadProps(__spreadValues({}, image), { className: clsx20("card-image", UpcomingEventCard_module_default["event-card-image"]) })),
1805
- /* @__PURE__ */ jsxs("div", { className: clsx20("card-text-content", UpcomingEventCard_module_default["event-card-text-content"]), children: [
1806
- /* @__PURE__ */ jsx("span", { className: UpcomingEventCard_module_default.date, children: date }),
1807
- title && /* @__PURE__ */ jsx("h3", { className: clsx20("card-text-title"), children: title }),
1808
- location && /* @__PURE__ */ jsx("span", { className: UpcomingEventCard_module_default.location, children: location }),
1809
- description && /* @__PURE__ */ jsx("div", { className: clsx20("card-text-description", UpcomingEventCard_module_default.description), children: description }),
1810
- cta && cta.url && /* @__PURE__ */ jsx(
1811
- Button,
1812
- {
1813
- variant: "secondary",
1814
- className: clsx20(
1815
- "card-cta",
1816
- UpcomingEventCard_module_default["event-card-cta"],
1817
- !hasCTAandImage && UpcomingEventCard_module_default.hidden
1818
- ),
1819
- fullWidth: isBelowMobile,
1820
- href: cta.url,
1821
- icon: cta.icon,
1822
- children: cta.label
1823
- }
1824
- )
1825
- ] })
1807
+ /* @__PURE__ */ jsxs(
1808
+ "div",
1809
+ {
1810
+ className: clsx20(
1811
+ "card-text-content",
1812
+ UpcomingEventCard_module_default["event-card-text-content"],
1813
+ (!showImage || !hasImage) && UpcomingEventCard_module_default["event-card-show-image"]
1814
+ ),
1815
+ children: [
1816
+ /* @__PURE__ */ jsx("span", { className: UpcomingEventCard_module_default.date, children: date }),
1817
+ title && /* @__PURE__ */ jsx("h3", { className: clsx20("card-text-title"), children: title }),
1818
+ location && /* @__PURE__ */ jsx("span", { className: UpcomingEventCard_module_default.location, children: location }),
1819
+ description && /* @__PURE__ */ jsx("div", { className: clsx20("card-text-description", UpcomingEventCard_module_default.description), children: description }),
1820
+ cta && cta.url && /* @__PURE__ */ jsx(
1821
+ Button,
1822
+ {
1823
+ variant: "secondary",
1824
+ className: clsx20(
1825
+ "card-cta",
1826
+ UpcomingEventCard_module_default["event-card-cta"],
1827
+ !hasCTAandImage && UpcomingEventCard_module_default.hidden
1828
+ ),
1829
+ fullWidth: isBelowMobile,
1830
+ href: cta.url,
1831
+ icon: cta.icon,
1832
+ isExternal: cta == null ? void 0 : cta.isExternal,
1833
+ children: cta.label
1834
+ }
1835
+ )
1836
+ ]
1837
+ }
1838
+ )
1826
1839
  ] }),
1827
1840
  cta && cta.url && /* @__PURE__ */ jsx(
1828
1841
  "div",
@@ -1836,6 +1849,7 @@ var UpcomingEventCard = ({
1836
1849
  fullWidth: isBelowMobile,
1837
1850
  href: cta.url,
1838
1851
  icon: cta.icon,
1852
+ isExternal: cta == null ? void 0 : cta.isExternal,
1839
1853
  children: cta.label
1840
1854
  }
1841
1855
  )
@@ -1849,22 +1863,35 @@ var UpcomingEventCard = ({
1849
1863
  // src/components/Carousel/Carousel.module.scss
1850
1864
  var Carousel_module_default = {};
1851
1865
  var Carousel = (_a) => {
1852
- var _b = _a, { slides, className } = _b, props = __objRest(_b, ["slides", "className"]);
1866
+ var _b = _a, {
1867
+ slides,
1868
+ className,
1869
+ ariaLabel = "Carousel"
1870
+ } = _b, props = __objRest(_b, [
1871
+ "slides",
1872
+ "className",
1873
+ "ariaLabel"
1874
+ ]);
1853
1875
  return /* @__PURE__ */ jsx(
1854
1876
  Swiper,
1855
1877
  __spreadProps(__spreadValues({
1878
+ a11y: {
1879
+ enabled: true,
1880
+ containerMessage: ariaLabel,
1881
+ containerRoleDescriptionMessage: "carousel"
1882
+ },
1883
+ role: "region",
1884
+ "aria-label": ariaLabel,
1856
1885
  className: clsx20(Carousel_module_default.carousel, className),
1857
1886
  spaceBetween: 0,
1858
1887
  slidesPerView: "auto",
1859
- modules: [FreeMode],
1888
+ modules: [FreeMode, A11y],
1860
1889
  freeMode: { enabled: true, sticky: false, momentum: true },
1861
- wrapperTag: "ul",
1862
1890
  loop: false
1863
1891
  }, props), {
1864
1892
  children: slides.map((slide, index) => /* @__PURE__ */ jsx(
1865
1893
  SwiperSlide,
1866
1894
  {
1867
- tag: "li",
1868
1895
  className: clsx20(Carousel_module_default["carousel-item"], props.slideClass),
1869
1896
  children: slide
1870
1897
  },
@@ -1878,11 +1905,13 @@ var Carousel = (_a) => {
1878
1905
  var EventList_module_default = {
1879
1906
  "event-list-module": "EventList_module_event-list-module",
1880
1907
  "event-list-header-container": "EventList_module_event-list-header-container",
1908
+ "event-list-title": "EventList_module_event-list-title",
1881
1909
  "event-list-wrapper": "EventList_module_event-list-wrapper",
1882
1910
  vertical: "EventList_module_vertical",
1883
- grey: "EventList_module_grey",
1884
1911
  "card-list-item": "EventList_module_card-list-item",
1885
1912
  "card-item": "EventList_module_card-item",
1913
+ internalEventList: "EventList_module_internalEventList",
1914
+ "events-page": "EventList_module_events-page",
1886
1915
  horizontal: "EventList_module_horizontal",
1887
1916
  "carousel-wrapper": "EventList_module_carousel-wrapper",
1888
1917
  "carousel-list-item": "EventList_module_carousel-list-item",
@@ -1891,35 +1920,52 @@ var EventList_module_default = {
1891
1920
  var EventListTitle = ({ children }) => {
1892
1921
  return /* @__PURE__ */ jsx(Fragment, { children });
1893
1922
  };
1894
- var EventList = ({ className, title, items, cta, variant, children }) => {
1923
+ var EventList = ({
1924
+ className,
1925
+ title,
1926
+ items,
1927
+ cta,
1928
+ backgroundColor,
1929
+ variant,
1930
+ children
1931
+ }) => {
1895
1932
  var _a;
1896
1933
  const { is } = useViewPort_default();
1897
1934
  const slots = resolveCompoundSlots(children, {
1898
1935
  title: EventListTitle
1899
1936
  });
1900
1937
  const titleNode = (_a = slots.title) != null ? _a : title;
1901
- const isGrey = variant === "grey";
1902
1938
  const isBelowTablet = is("tablet", "below");
1903
1939
  const cardDirection = isBelowTablet ? "vertical" : "horizontal";
1904
- const listDirection = isGrey ? "horizontal" : "vertical";
1940
+ const isInternalEventList = variant === "internalEventList";
1941
+ const listDirection = isInternalEventList ? "horizontal" : "vertical";
1905
1942
  return /* @__PURE__ */ jsx(
1906
1943
  "div",
1907
1944
  {
1908
- className: clsx20(
1909
- "event-list-module",
1910
- EventList_module_default["event-list-module"],
1911
- isGrey && EventList_module_default[variant],
1912
- className
1913
- ),
1945
+ className: clsx20("event-list-module", EventList_module_default["event-list-module"], className),
1946
+ style: {
1947
+ backgroundColor
1948
+ },
1914
1949
  children: /* @__PURE__ */ jsxs(Container, { className: clsx20(EventList_module_default["event-list-container"]), children: [
1915
1950
  /* @__PURE__ */ jsxs("div", { className: EventList_module_default["event-list-header-container"], children: [
1916
- titleNode && /* @__PURE__ */ jsx("h2", { children: titleNode }),
1917
- cta && cta.url && /* @__PURE__ */ jsx(Button, { className: EventList_module_default.cta, variant: "nofillblack", href: cta.url, icon: cta.icon, children: cta.label })
1951
+ titleNode && /* @__PURE__ */ jsx("h2", { className: clsx20(EventList_module_default["event-list-title"]), children: titleNode }),
1952
+ cta && cta.url && /* @__PURE__ */ jsx(
1953
+ Button,
1954
+ {
1955
+ className: EventList_module_default.cta,
1956
+ variant: "nofillblack",
1957
+ href: cta.url,
1958
+ icon: cta.icon,
1959
+ isExternal: cta == null ? void 0 : cta.isExternal,
1960
+ children: cta.label
1961
+ }
1962
+ )
1918
1963
  ] }),
1919
- isGrey && isBelowTablet && /* @__PURE__ */ jsx(
1964
+ isInternalEventList && isBelowTablet && /* @__PURE__ */ jsx(
1920
1965
  Carousel,
1921
1966
  {
1922
- wrapperClass: clsx20(EventList_module_default["carousel-wrapper"]),
1967
+ "aria-label": "Upcoming events",
1968
+ wrapperClass: clsx20(EventList_module_default["carousel-wrapper"], EventList_module_default[variant]),
1923
1969
  slideClass: EventList_module_default["carousel-list-item"],
1924
1970
  spaceBetween: 16,
1925
1971
  slides: items.map((item) => {
@@ -1927,7 +1973,7 @@ var EventList = ({ className, title, items, cta, variant, children }) => {
1927
1973
  return /* @__PURE__ */ jsx(
1928
1974
  UpcomingEventCard,
1929
1975
  __spreadValues({
1930
- className: isGrey && EventList_module_default["event-card"],
1976
+ className: clsx20(EventList_module_default["event-card"]),
1931
1977
  direction: "vertical",
1932
1978
  showImage: false
1933
1979
  }, item),
@@ -1936,28 +1982,42 @@ var EventList = ({ className, title, items, cta, variant, children }) => {
1936
1982
  })
1937
1983
  }
1938
1984
  ),
1939
- isGrey && !isBelowTablet && /* @__PURE__ */ jsx("ul", { className: clsx20(EventList_module_default["event-list-wrapper"], EventList_module_default["horizontal"], EventList_module_default[variant]), children: items == null ? void 0 : items.map((item, index) => {
1940
- var _a2, _b, _c;
1941
- return /* @__PURE__ */ jsx(
1942
- "li",
1943
- {
1944
- className: clsx20(EventList_module_default["card-list-item"]),
1945
- children: /* @__PURE__ */ jsx(
1946
- UpcomingEventCard,
1947
- __spreadProps(__spreadValues({}, item), {
1948
- className: isGrey && EventList_module_default["card-item"],
1949
- showImage: false,
1950
- direction: "vertical"
1951
- })
1952
- )
1953
- },
1954
- (_c = (_b = (_a2 = item.title) != null ? _a2 : item.date) != null ? _b : item.location) != null ? _c : index
1955
- );
1956
- }) }),
1957
- !isGrey && /* @__PURE__ */ jsx("ul", { className: clsx20(EventList_module_default["event-list-wrapper"], EventList_module_default[listDirection]), children: items == null ? void 0 : items.map((item, index) => {
1958
- var _a2, _b, _c;
1959
- 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);
1960
- }) })
1985
+ isInternalEventList && !isBelowTablet && /* @__PURE__ */ jsx(
1986
+ "ul",
1987
+ {
1988
+ "aria-label": "Upcoming events",
1989
+ className: clsx20(EventList_module_default["event-list-wrapper"], EventList_module_default["horizontal"], EventList_module_default[variant]),
1990
+ children: items == null ? void 0 : items.map((item, index) => {
1991
+ var _a2, _b, _c;
1992
+ return /* @__PURE__ */ jsx(
1993
+ "li",
1994
+ {
1995
+ className: clsx20(EventList_module_default["card-list-item"]),
1996
+ children: /* @__PURE__ */ jsx(
1997
+ UpcomingEventCard,
1998
+ __spreadProps(__spreadValues({}, item), {
1999
+ className: clsx20(EventList_module_default["card-item"]),
2000
+ showImage: false,
2001
+ direction: "vertical"
2002
+ })
2003
+ )
2004
+ },
2005
+ (_c = (_b = (_a2 = item.title) != null ? _a2 : item.date) != null ? _b : item.location) != null ? _c : index
2006
+ );
2007
+ })
2008
+ }
2009
+ ),
2010
+ !isInternalEventList && /* @__PURE__ */ jsx(
2011
+ "ul",
2012
+ {
2013
+ "aria-label": "Upcoming events",
2014
+ className: clsx20(EventList_module_default["event-list-wrapper"], EventList_module_default[listDirection]),
2015
+ children: items == null ? void 0 : items.map((item, index) => {
2016
+ var _a2, _b, _c;
2017
+ 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);
2018
+ })
2019
+ }
2020
+ )
1961
2021
  ] })
1962
2022
  }
1963
2023
  );