@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/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Luxottica
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Luxottica
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,52 +1,52 @@
1
- # CoreUI Kit
2
-
3
- A React‑based design system and component library.
4
-
5
- ## 🚀 Getting Started
6
-
7
- Install
8
-
9
- ```bash
10
- npm install
11
- ```
12
-
13
- Development
14
-
15
- - Run the build in watch mode
16
-
17
- ```bash
18
- npm run dev
19
- ```
20
-
21
- Start Storybook
22
-
23
- ```bash
24
- npm run storybook
25
- ```
26
-
27
- Run tests
28
-
29
- ```bash
30
- npm test
31
- ```
32
-
33
- Lint/format
34
-
35
- ```bash
36
- npm run lint
37
- ```
38
-
39
- ## 🛠️ Usage
40
-
41
- Import components in other projects:
42
-
43
- ```ts
44
- import '@digital-b2c/coreui-kit/styles.css'
45
-
46
- import { MiniSectionCta } from '@digital-b2c/coreui-kit'
47
-
48
- <MiniSectionCta>
49
- <MiniSectionCta.Title>Header</MiniSectionCta.Title>
50
- <MiniSectionCta.Subtitle>Description</MiniSectionCta.Subtitle>
51
- </MiniSectionCta>
52
- ```
1
+ # CoreUI Kit
2
+
3
+ A React‑based design system and component library.
4
+
5
+ ## 🚀 Getting Started
6
+
7
+ Install
8
+
9
+ ```bash
10
+ npm install
11
+ ```
12
+
13
+ Development
14
+
15
+ - Run the build in watch mode
16
+
17
+ ```bash
18
+ npm run dev
19
+ ```
20
+
21
+ Start Storybook
22
+
23
+ ```bash
24
+ npm run storybook
25
+ ```
26
+
27
+ Run tests
28
+
29
+ ```bash
30
+ npm test
31
+ ```
32
+
33
+ Lint/format
34
+
35
+ ```bash
36
+ npm run lint
37
+ ```
38
+
39
+ ## 🛠️ Usage
40
+
41
+ Import components in other projects:
42
+
43
+ ```ts
44
+ import '@digital-b2c/coreui-kit/styles.css'
45
+
46
+ import { MiniSectionCta } from '@digital-b2c/coreui-kit'
47
+
48
+ <MiniSectionCta>
49
+ <MiniSectionCta.Title>Header</MiniSectionCta.Title>
50
+ <MiniSectionCta.Subtitle>Description</MiniSectionCta.Subtitle>
51
+ </MiniSectionCta>
52
+ ```
package/dist/index.cjs CHANGED
@@ -688,10 +688,23 @@ Container.displayName = "Container";
688
688
  // src/components/Card/Card.module.scss
689
689
  var Card_module_default = {
690
690
  card: "Card_module_card",
691
- logo: "Card_module_logo",
692
- subtitle: "Card_module_subtitle"
691
+ dark: "Card_module_dark",
692
+ content: "Card_module_content",
693
+ subtitle: "Card_module_subtitle",
694
+ light: "Card_module_light",
695
+ logo: "Card_module_logo"
693
696
  };
694
- var Card = ({ className, title, subtitle, cta, icon, logo, children, ref }) => {
697
+ var Card = ({
698
+ className,
699
+ variant = "dark",
700
+ title,
701
+ subtitle,
702
+ cta,
703
+ icon,
704
+ logo,
705
+ children,
706
+ ref
707
+ }) => {
695
708
  var _a, _b;
696
709
  const { url: href, label, isExternal } = cta != null ? cta : {};
697
710
  const slots = resolveCompoundSlots(children, {
@@ -700,12 +713,11 @@ var Card = ({ className, title, subtitle, cta, icon, logo, children, ref }) => {
700
713
  });
701
714
  const titleNode = (_a = slots.title) != null ? _a : title;
702
715
  const subtitleNode = (_b = slots.subtitle) != null ? _b : subtitle;
703
- console.log(href && !label, href, !label);
704
716
  return /* @__PURE__ */ jsxRuntime.jsxs(
705
717
  ConditionalWrapper,
706
718
  __spreadProps(__spreadValues({
707
719
  ref,
708
- className: clsx19__default.default(Card_module_default.card, className),
720
+ className: clsx19__default.default(Card_module_default.card, Card_module_default[variant], className),
709
721
  wrapper: Anchor,
710
722
  fallback: "div",
711
723
  condition: href && !label
@@ -942,6 +954,7 @@ var CardCollection_module_default = {
942
954
  var CardCollection = ({
943
955
  className,
944
956
  variant = "default",
957
+ theme = "dark",
945
958
  title,
946
959
  subtitle,
947
960
  cards = [],
@@ -1002,8 +1015,16 @@ var CardCollection = ({
1002
1015
  subtitleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "subheading", children: subtitleNode })
1003
1016
  ] }),
1004
1017
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: CardCollection_module_default.wrapper, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx19__default.default(CardCollection_module_default.cardWrapper, { [CardCollection_module_default["is-expanded"]]: isExpanded }), children: [
1005
- visibleCards.map((card, key) => /* @__PURE__ */ jsxRuntime.jsx(Card2, __spreadValues({ className: CardCollection_module_default.card }, card), key)),
1006
- isExamCard && hiddenCards.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: revealWrapper, className: CardCollection_module_default["reveal-wrapper"], children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: CardCollection_module_default["reveal-inner"], children: hiddenCards.map((card, key) => /* @__PURE__ */ jsxRuntime.jsx(Card2, __spreadValues({ ref: extraCard, className: CardCollection_module_default.card }, card), key)) }) }),
1018
+ visibleCards.map((card, key) => /* @__PURE__ */ jsxRuntime.jsx(Card2, __spreadValues({ className: CardCollection_module_default.card, variant: theme }, card), key)),
1019
+ isExamCard && hiddenCards.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: revealWrapper, className: CardCollection_module_default["reveal-wrapper"], children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: CardCollection_module_default["reveal-inner"], children: hiddenCards.map((card, key) => /* @__PURE__ */ jsxRuntime.jsx(
1020
+ Card2,
1021
+ __spreadValues({
1022
+ ref: extraCard,
1023
+ className: CardCollection_module_default.card,
1024
+ variant: theme
1025
+ }, card),
1026
+ key
1027
+ )) }) }),
1007
1028
  isExamCard && !isExpanded && ctaLabel && /* @__PURE__ */ jsxRuntime.jsx(
1008
1029
  Button,
1009
1030
  {
@@ -1409,12 +1430,15 @@ var MiniSectionCta_module_default = {
1409
1430
  infoCallout: "MiniSectionCta_module_infoCallout",
1410
1431
  subtitle: "MiniSectionCta_module_subtitle",
1411
1432
  miniTextCenterCta: "MiniSectionCta_module_miniTextCenterCta",
1433
+ light: "MiniSectionCta_module_light",
1434
+ dark: "MiniSectionCta_module_dark",
1412
1435
  cta: "MiniSectionCta_module_cta",
1413
1436
  BgColorGrey: "MiniSectionCta_module_BgColorGrey"
1414
1437
  };
1415
1438
  var MiniSectionCta = ({
1416
1439
  className,
1417
1440
  variant = "headerCTA",
1441
+ theme,
1418
1442
  title,
1419
1443
  subtitle,
1420
1444
  cta,
@@ -1427,29 +1451,35 @@ var MiniSectionCta = ({
1427
1451
  });
1428
1452
  const titleNode = (_a = slots.title) != null ? _a : title;
1429
1453
  const subtitleNode = (_b = slots.subtitle) != null ? _b : subtitle;
1430
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx19__default.default(MiniSectionCta_module_default.miniSectionCta, MiniSectionCta_module_default[variant], className), children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: MiniSectionCta_module_default.wrapper, children: [
1431
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: MiniSectionCta_module_default.col, children: [
1432
- titleNode && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: variant === "BgColorBlack" || variant === "BgColorGrey" ? "h3" : "h2", children: titleNode }),
1433
- subtitleNode && /* @__PURE__ */ jsxRuntime.jsx(
1434
- "div",
1435
- {
1436
- className: clsx19__default.default(MiniSectionCta_module_default.subtitle, variant === "infoCallout" ? "h4" : "subheading"),
1437
- children: subtitleNode
1438
- }
1439
- )
1440
- ] }),
1441
- cta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: MiniSectionCta_module_default.col, children: /* @__PURE__ */ jsxRuntime.jsx(
1442
- Button,
1443
- {
1444
- className: MiniSectionCta_module_default.cta,
1445
- href: cta.url,
1446
- isExternal: cta.isExternal,
1447
- variant: variant === "BgColorBlack" ? "shiny" : "primary",
1448
- icon: variant === "miniTextCenterCta" ? "tiltedRightWhite" : void 0,
1449
- children: cta.label
1450
- }
1451
- ) })
1452
- ] }) }) });
1454
+ return /* @__PURE__ */ jsxRuntime.jsx(
1455
+ "div",
1456
+ {
1457
+ className: clsx19__default.default(MiniSectionCta_module_default.miniSectionCta, MiniSectionCta_module_default[variant], theme && MiniSectionCta_module_default[theme], className),
1458
+ children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: MiniSectionCta_module_default.wrapper, children: [
1459
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: MiniSectionCta_module_default.col, children: [
1460
+ titleNode && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: variant === "BgColorBlack" || variant === "BgColorGrey" ? "h3" : "h2", children: titleNode }),
1461
+ subtitleNode && /* @__PURE__ */ jsxRuntime.jsx(
1462
+ "div",
1463
+ {
1464
+ className: clsx19__default.default(MiniSectionCta_module_default.subtitle, variant === "infoCallout" ? "h4" : "subheading"),
1465
+ children: subtitleNode
1466
+ }
1467
+ )
1468
+ ] }),
1469
+ cta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: MiniSectionCta_module_default.col, children: /* @__PURE__ */ jsxRuntime.jsx(
1470
+ Button,
1471
+ {
1472
+ className: MiniSectionCta_module_default.cta,
1473
+ href: cta.url,
1474
+ isExternal: cta.isExternal,
1475
+ variant: variant === "BgColorBlack" ? "shiny" : "primary",
1476
+ icon: variant === "miniTextCenterCta" ? "tiltedRightWhite" : void 0,
1477
+ children: cta.label
1478
+ }
1479
+ ) })
1480
+ ] }) })
1481
+ }
1482
+ );
1453
1483
  };
1454
1484
 
1455
1485
  // src/widgets/MiniSectionCta/index.ts