@digital-b2c/coreui-kit 0.5.5 → 0.6.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.d.ts CHANGED
@@ -125,6 +125,7 @@ type CardTitleProps = {
125
125
 
126
126
  interface CardProps {
127
127
  className?: string;
128
+ variant?: 'light' | 'dark';
128
129
  title?: ReactNode;
129
130
  subtitle?: ReactNode;
130
131
  icon?: IconType;
@@ -135,7 +136,7 @@ interface CardProps {
135
136
  }
136
137
 
137
138
  declare const Card: {
138
- ({ className, title, subtitle, cta, icon, logo, children, ref }: CardProps): react_jsx_runtime.JSX.Element;
139
+ ({ className, variant, title, subtitle, cta, icon, logo, children, ref, }: CardProps): react_jsx_runtime.JSX.Element;
139
140
  displayName: string;
140
141
  } & {
141
142
  Title: ({ children }: CardTitleProps) => react_jsx_runtime.JSX.Element;
@@ -243,9 +244,10 @@ interface CardCollectionProps {
243
244
  cards?: CardProps[];
244
245
  children?: ReactNode;
245
246
  ctaLabel?: string;
247
+ theme?: 'dark' | 'light';
246
248
  }
247
249
 
248
- declare const CardCollection: (({ className, variant, title, subtitle, cards, ctaLabel, children, }: CardCollectionProps) => react_jsx_runtime.JSX.Element) & {
250
+ declare const CardCollection: (({ className, variant, theme, title, subtitle, cards, ctaLabel, children, }: CardCollectionProps) => react_jsx_runtime.JSX.Element) & {
249
251
  Title: ({ children }: CardCollectionTitleProps) => react_jsx_runtime.JSX.Element;
250
252
  Subtitle: ({ children }: CardCollectionSubtitleProps) => react_jsx_runtime.JSX.Element;
251
253
  };
@@ -356,13 +358,14 @@ type MiniSectionCtaTitleProps = {
356
358
  interface MiniSectionCtaProps {
357
359
  className?: string;
358
360
  variant?: 'headerCTA' | 'BgColorBlack' | 'BgColorGrey' | 'infoCallout' | 'miniTextCenterCta';
361
+ theme?: 'light' | 'dark';
359
362
  cta?: ICta;
360
363
  title?: ReactNode;
361
364
  subtitle?: ReactNode;
362
365
  children?: ReactNode;
363
366
  }
364
367
 
365
- declare const MiniSectionCta: (({ className, variant, title, subtitle, cta, children, }: MiniSectionCtaProps) => react_jsx_runtime.JSX.Element) & {
368
+ declare const MiniSectionCta: (({ className, variant, theme, title, subtitle, cta, children, }: MiniSectionCtaProps) => react_jsx_runtime.JSX.Element) & {
366
369
  Title: ({ children }: MiniSectionCtaTitleProps) => react_jsx_runtime.JSX.Element;
367
370
  Subtitle: ({ children }: MiniSectionCtaSubtitleProps) => react_jsx_runtime.JSX.Element;
368
371
  };
package/dist/index.mjs CHANGED
@@ -680,10 +680,23 @@ Container.displayName = "Container";
680
680
  // src/components/Card/Card.module.scss
681
681
  var Card_module_default = {
682
682
  card: "Card_module_card",
683
- logo: "Card_module_logo",
684
- subtitle: "Card_module_subtitle"
683
+ dark: "Card_module_dark",
684
+ content: "Card_module_content",
685
+ subtitle: "Card_module_subtitle",
686
+ light: "Card_module_light",
687
+ logo: "Card_module_logo"
685
688
  };
686
- var Card = ({ className, title, subtitle, cta, icon, logo, children, ref }) => {
689
+ var Card = ({
690
+ className,
691
+ variant = "dark",
692
+ title,
693
+ subtitle,
694
+ cta,
695
+ icon,
696
+ logo,
697
+ children,
698
+ ref
699
+ }) => {
687
700
  var _a, _b;
688
701
  const { url: href, label, isExternal } = cta != null ? cta : {};
689
702
  const slots = resolveCompoundSlots(children, {
@@ -692,12 +705,11 @@ var Card = ({ className, title, subtitle, cta, icon, logo, children, ref }) => {
692
705
  });
693
706
  const titleNode = (_a = slots.title) != null ? _a : title;
694
707
  const subtitleNode = (_b = slots.subtitle) != null ? _b : subtitle;
695
- console.log(href && !label, href, !label);
696
708
  return /* @__PURE__ */ jsxs(
697
709
  ConditionalWrapper,
698
710
  __spreadProps(__spreadValues({
699
711
  ref,
700
- className: clsx19(Card_module_default.card, className),
712
+ className: clsx19(Card_module_default.card, Card_module_default[variant], className),
701
713
  wrapper: Anchor,
702
714
  fallback: "div",
703
715
  condition: href && !label
@@ -934,6 +946,7 @@ var CardCollection_module_default = {
934
946
  var CardCollection = ({
935
947
  className,
936
948
  variant = "default",
949
+ theme = "dark",
937
950
  title,
938
951
  subtitle,
939
952
  cards = [],
@@ -994,8 +1007,16 @@ var CardCollection = ({
994
1007
  subtitleNode && /* @__PURE__ */ jsx("div", { className: "subheading", children: subtitleNode })
995
1008
  ] }),
996
1009
  /* @__PURE__ */ jsx("div", { className: CardCollection_module_default.wrapper, children: /* @__PURE__ */ jsxs("div", { className: clsx19(CardCollection_module_default.cardWrapper, { [CardCollection_module_default["is-expanded"]]: isExpanded }), children: [
997
- visibleCards.map((card, key) => /* @__PURE__ */ jsx(Card2, __spreadValues({ className: CardCollection_module_default.card }, card), key)),
998
- isExamCard && hiddenCards.length > 0 && /* @__PURE__ */ jsx("div", { ref: revealWrapper, className: CardCollection_module_default["reveal-wrapper"], children: /* @__PURE__ */ jsx("div", { className: CardCollection_module_default["reveal-inner"], children: hiddenCards.map((card, key) => /* @__PURE__ */ jsx(Card2, __spreadValues({ ref: extraCard, className: CardCollection_module_default.card }, card), key)) }) }),
1010
+ visibleCards.map((card, key) => /* @__PURE__ */ jsx(Card2, __spreadValues({ className: CardCollection_module_default.card, variant: theme }, card), key)),
1011
+ isExamCard && hiddenCards.length > 0 && /* @__PURE__ */ jsx("div", { ref: revealWrapper, className: CardCollection_module_default["reveal-wrapper"], children: /* @__PURE__ */ jsx("div", { className: CardCollection_module_default["reveal-inner"], children: hiddenCards.map((card, key) => /* @__PURE__ */ jsx(
1012
+ Card2,
1013
+ __spreadValues({
1014
+ ref: extraCard,
1015
+ className: CardCollection_module_default.card,
1016
+ variant: theme
1017
+ }, card),
1018
+ key
1019
+ )) }) }),
999
1020
  isExamCard && !isExpanded && ctaLabel && /* @__PURE__ */ jsx(
1000
1021
  Button,
1001
1022
  {
@@ -1401,12 +1422,15 @@ var MiniSectionCta_module_default = {
1401
1422
  infoCallout: "MiniSectionCta_module_infoCallout",
1402
1423
  subtitle: "MiniSectionCta_module_subtitle",
1403
1424
  miniTextCenterCta: "MiniSectionCta_module_miniTextCenterCta",
1425
+ light: "MiniSectionCta_module_light",
1426
+ dark: "MiniSectionCta_module_dark",
1404
1427
  cta: "MiniSectionCta_module_cta",
1405
1428
  BgColorGrey: "MiniSectionCta_module_BgColorGrey"
1406
1429
  };
1407
1430
  var MiniSectionCta = ({
1408
1431
  className,
1409
1432
  variant = "headerCTA",
1433
+ theme,
1410
1434
  title,
1411
1435
  subtitle,
1412
1436
  cta,
@@ -1419,29 +1443,35 @@ var MiniSectionCta = ({
1419
1443
  });
1420
1444
  const titleNode = (_a = slots.title) != null ? _a : title;
1421
1445
  const subtitleNode = (_b = slots.subtitle) != null ? _b : subtitle;
1422
- return /* @__PURE__ */ jsx("div", { className: clsx19(MiniSectionCta_module_default.miniSectionCta, MiniSectionCta_module_default[variant], className), children: /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsxs("div", { className: MiniSectionCta_module_default.wrapper, children: [
1423
- /* @__PURE__ */ jsxs("div", { className: MiniSectionCta_module_default.col, children: [
1424
- titleNode && /* @__PURE__ */ jsx("h2", { className: variant === "BgColorBlack" || variant === "BgColorGrey" ? "h3" : "h2", children: titleNode }),
1425
- subtitleNode && /* @__PURE__ */ jsx(
1426
- "div",
1427
- {
1428
- className: clsx19(MiniSectionCta_module_default.subtitle, variant === "infoCallout" ? "h4" : "subheading"),
1429
- children: subtitleNode
1430
- }
1431
- )
1432
- ] }),
1433
- cta && /* @__PURE__ */ jsx("div", { className: MiniSectionCta_module_default.col, children: /* @__PURE__ */ jsx(
1434
- Button,
1435
- {
1436
- className: MiniSectionCta_module_default.cta,
1437
- href: cta.url,
1438
- isExternal: cta.isExternal,
1439
- variant: variant === "BgColorBlack" ? "shiny" : "primary",
1440
- icon: variant === "miniTextCenterCta" ? "tiltedRightWhite" : void 0,
1441
- children: cta.label
1442
- }
1443
- ) })
1444
- ] }) }) });
1446
+ return /* @__PURE__ */ jsx(
1447
+ "div",
1448
+ {
1449
+ className: clsx19(MiniSectionCta_module_default.miniSectionCta, MiniSectionCta_module_default[variant], theme && MiniSectionCta_module_default[theme], className),
1450
+ children: /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsxs("div", { className: MiniSectionCta_module_default.wrapper, children: [
1451
+ /* @__PURE__ */ jsxs("div", { className: MiniSectionCta_module_default.col, children: [
1452
+ titleNode && /* @__PURE__ */ jsx("h2", { className: variant === "BgColorBlack" || variant === "BgColorGrey" ? "h3" : "h2", children: titleNode }),
1453
+ subtitleNode && /* @__PURE__ */ jsx(
1454
+ "div",
1455
+ {
1456
+ className: clsx19(MiniSectionCta_module_default.subtitle, variant === "infoCallout" ? "h4" : "subheading"),
1457
+ children: subtitleNode
1458
+ }
1459
+ )
1460
+ ] }),
1461
+ cta && /* @__PURE__ */ jsx("div", { className: MiniSectionCta_module_default.col, children: /* @__PURE__ */ jsx(
1462
+ Button,
1463
+ {
1464
+ className: MiniSectionCta_module_default.cta,
1465
+ href: cta.url,
1466
+ isExternal: cta.isExternal,
1467
+ variant: variant === "BgColorBlack" ? "shiny" : "primary",
1468
+ icon: variant === "miniTextCenterCta" ? "tiltedRightWhite" : void 0,
1469
+ children: cta.label
1470
+ }
1471
+ ) })
1472
+ ] }) })
1473
+ }
1474
+ );
1445
1475
  };
1446
1476
 
1447
1477
  // src/widgets/MiniSectionCta/index.ts