@digital-b2c/coreui-kit 0.5.2 → 0.5.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/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
@@ -673,54 +673,40 @@ function resolveCompoundSlots(children, slots) {
673
673
  return resolved;
674
674
  }
675
675
 
676
- // src/components/primitives/Container/Container.module.scss
677
- var Container_module_default = {
678
- container: "Container_module_container"
679
- };
680
- var Container = React52.forwardRef(
681
- (_a, ref) => {
682
- var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
683
- return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({ ref, className: clsx19__default.default(Container_module_default.container, className) }, props), { children }));
684
- }
685
- );
686
- Container.displayName = "Container";
687
-
688
676
  // src/components/Card/Card.module.scss
689
677
  var Card_module_default = {
690
678
  card: "Card_module_card",
691
679
  logo: "Card_module_logo",
692
680
  subtitle: "Card_module_subtitle"
693
681
  };
694
- var Card = ({ className, title, subtitle, cta, icon, logo, children, ref }) => {
695
- var _a, _b;
696
- const { url: href, label, isExternal } = cta != null ? cta : {};
697
- const slots = resolveCompoundSlots(children, {
698
- title: CardTitle,
699
- subtitle: CardSubtitle
700
- });
701
- const titleNode = (_a = slots.title) != null ? _a : title;
702
- const subtitleNode = (_b = slots.subtitle) != null ? _b : subtitle;
703
- console.log(href && !label, href, !label);
704
- return /* @__PURE__ */ jsxRuntime.jsxs(
705
- ConditionalWrapper,
706
- __spreadProps(__spreadValues({
707
- ref,
708
- className: clsx19__default.default(Card_module_default.card, className),
709
- wrapper: Anchor,
710
- fallback: "div",
711
- condition: href && !label
712
- }, href ? { href, isExternal } : {}), {
713
- children: [
714
- (logo == null ? void 0 : logo.src) ? /* @__PURE__ */ jsxRuntime.jsx(Picture, __spreadValues({ className: Card_module_default.logo }, logo)) : icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: icon, className: Card_module_default.logo }),
715
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Card_module_default.content, children: [
716
- titleNode && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "h4", children: titleNode }),
717
- subtitleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Card_module_default.subtitle, children: subtitleNode })
718
- ] }),
719
- (cta == null ? void 0 : cta.label) && /* @__PURE__ */ jsxRuntime.jsx(Button, { href: cta.url, isExternal: cta.isExternal, variant: "secondary", icon: cta.icon, children: cta.label })
720
- ]
721
- })
722
- );
723
- };
682
+ var Card = React52.forwardRef(
683
+ ({ className, title, subtitle, cta, icon, logo, children }, ref) => {
684
+ var _a, _b;
685
+ const slots = resolveCompoundSlots(children, {
686
+ title: CardTitle,
687
+ subtitle: CardSubtitle
688
+ });
689
+ const titleNode = (_a = slots.title) != null ? _a : title;
690
+ const subtitleNode = (_b = slots.subtitle) != null ? _b : subtitle;
691
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: clsx19__default.default(Card_module_default.card, className), children: [
692
+ (logo == null ? void 0 : logo.src) ? /* @__PURE__ */ jsxRuntime.jsx(Picture, __spreadValues({ className: Card_module_default.logo }, logo)) : icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: icon, className: Card_module_default.logo }),
693
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Card_module_default.content, children: [
694
+ titleNode && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "h4", children: titleNode }),
695
+ subtitleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Card_module_default.subtitle, children: subtitleNode })
696
+ ] }),
697
+ cta && /* @__PURE__ */ jsxRuntime.jsx(
698
+ Button,
699
+ {
700
+ href: cta.url,
701
+ isExternal: cta.isExternal,
702
+ variant: "secondary",
703
+ icon: cta.url ? "rightBlack" : void 0,
704
+ children: cta.label
705
+ }
706
+ )
707
+ ] });
708
+ }
709
+ );
724
710
  Card.displayName = "Card";
725
711
 
726
712
  // src/components/Card/index.ts
@@ -883,6 +869,18 @@ var Pagination = ({
883
869
  ] });
884
870
  };
885
871
 
872
+ // src/components/primitives/Container/Container.module.scss
873
+ var Container_module_default = {
874
+ container: "Container_module_container"
875
+ };
876
+ var Container = React52.forwardRef(
877
+ (_a, ref) => {
878
+ var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
879
+ return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({ ref, className: clsx19__default.default(Container_module_default.container, className) }, props), { children }));
880
+ }
881
+ );
882
+ Container.displayName = "Container";
883
+
886
884
  // src/components/PracticeCard/PracticeCard.module.scss
887
885
  var PracticeCard_module_default = {
888
886
  "practice-card": "PracticeCard_module_practice-card",
@@ -931,7 +929,6 @@ var CardCollection_module_default = {
931
929
  wrapper: "CardCollection_module_wrapper",
932
930
  cardWrapper: "CardCollection_module_cardWrapper",
933
931
  threeCols: "CardCollection_module_threeCols",
934
- fourCols: "CardCollection_module_fourCols",
935
932
  examCard: "CardCollection_module_examCard",
936
933
  "reveal-wrapper": "CardCollection_module_reveal-wrapper",
937
934
  "reveal-inner": "CardCollection_module_reveal-inner",
@@ -1787,71 +1784,38 @@ var TextEvent2 = Object.assign(TextEvent, {
1787
1784
  Title: TextEventTitle,
1788
1785
  RichText: TextEventRichText
1789
1786
  });
1790
- var TextCenterCtaInBottomTitle = ({ children }) => {
1787
+
1788
+ // src/widgets/TextBody/TextBody.module.scss
1789
+ var TextBody_module_default = {
1790
+ textBody: "TextBody_module_textBody",
1791
+ body: "TextBody_module_body",
1792
+ title: "TextBody_module_title"
1793
+ };
1794
+ var TextBodyTitle = ({ children }) => {
1791
1795
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
1792
1796
  };
1793
- var TextCenterCtaInBottomSubtitle = ({ children }) => {
1797
+ var TextBodyBody = ({ children }) => {
1794
1798
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
1795
1799
  };
1796
-
1797
- // src/widgets/TextCenterCtaInBottom/TextCenterCtaInBottom.module.scss
1798
- var TextCenterCtaInBottom_module_default = {
1799
- textCenterCta: "TextCenterCtaInBottom_module_textCenterCta",
1800
- container: "TextCenterCtaInBottom_module_container",
1801
- content: "TextCenterCtaInBottom_module_content",
1802
- title: "TextCenterCtaInBottom_module_title",
1803
- subtitle: "TextCenterCtaInBottom_module_subtitle",
1804
- ctaWrapper: "TextCenterCtaInBottom_module_ctaWrapper",
1805
- iconOnly: "TextCenterCtaInBottom_module_iconOnly",
1806
- cta: "TextCenterCtaInBottom_module_cta"
1807
- };
1808
- var TextCenterCtaInBottom = ({
1809
- className,
1810
- title,
1811
- subtitle,
1812
- ctas,
1813
- children
1814
- }) => {
1800
+ var TextBody = (props) => {
1815
1801
  var _a, _b;
1802
+ const { className, body, title, children } = props;
1816
1803
  const slots = resolveCompoundSlots(children, {
1817
- title: TextCenterCtaInBottomTitle,
1818
- subtitle: TextCenterCtaInBottomSubtitle
1804
+ title: TextBodyTitle,
1805
+ body: TextBodyBody
1819
1806
  });
1820
1807
  const titleNode = (_a = slots.title) != null ? _a : title;
1821
- const subtitleNode = (_b = slots.subtitle) != null ? _b : subtitle;
1822
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx19__default.default(TextCenterCtaInBottom_module_default.textCenterCta, className), children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { className: TextCenterCtaInBottom_module_default.container, children: [
1823
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: TextCenterCtaInBottom_module_default.content, children: [
1824
- titleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: TextCenterCtaInBottom_module_default.title, children: titleNode }),
1825
- subtitleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: TextCenterCtaInBottom_module_default.subtitle, children: subtitleNode })
1826
- ] }),
1827
- (ctas == null ? void 0 : ctas.length) && /* @__PURE__ */ jsxRuntime.jsx(
1828
- "div",
1829
- {
1830
- className: clsx19__default.default(
1831
- TextCenterCtaInBottom_module_default.ctaWrapper,
1832
- ctas.every((cta) => !cta.label && cta.logo) && TextCenterCtaInBottom_module_default.iconOnly
1833
- ),
1834
- children: ctas.map((cta, key) => /* @__PURE__ */ jsxRuntime.jsx(
1835
- Button,
1836
- {
1837
- className: TextCenterCtaInBottom_module_default.cta,
1838
- variant: "secondary",
1839
- href: cta == null ? void 0 : cta.url,
1840
- isExternal: cta == null ? void 0 : cta.isExternal,
1841
- logo: cta.logo,
1842
- children: cta == null ? void 0 : cta.label
1843
- },
1844
- key
1845
- ))
1846
- }
1847
- )
1848
- ] }) });
1808
+ const bodyNode = (_b = slots.body) != null ? _b : body;
1809
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container, { className: clsx19__default.default(TextBody_module_default.textBody, className), children: [
1810
+ titleNode && /* @__PURE__ */ jsxRuntime.jsx(Text, { tag: "h2", className: TextBody_module_default.title, children: titleNode }),
1811
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: TextBody_module_default.body, children: bodyNode })
1812
+ ] });
1849
1813
  };
1850
1814
 
1851
- // src/widgets/TextCenterCtaInBottom/index.ts
1852
- var TextCenterCtaInBottom2 = Object.assign(TextCenterCtaInBottom, {
1853
- Title: TextCenterCtaInBottomTitle,
1854
- Subtitle: TextCenterCtaInBottomSubtitle
1815
+ // src/widgets/TextBody/index.ts
1816
+ var TextBody2 = Object.assign(TextBody, {
1817
+ Title: TextBodyTitle,
1818
+ Body: TextBodyBody
1855
1819
  });
1856
1820
  function useIntersectionObserver({
1857
1821
  animateOnce = false,
@@ -1904,7 +1868,7 @@ exports.PracticeCard = PracticeCard;
1904
1868
  exports.PracticePathCards = PracticePathCards2;
1905
1869
  exports.Teaser5050With3Text = Teaser5050With3Text2;
1906
1870
  exports.Teaser5050WithCta = Teaser5050WithCta2;
1907
- exports.TextCenterCtaInBottom = TextCenterCtaInBottom2;
1871
+ exports.TextBody = TextBody2;
1908
1872
  exports.TextEvent = TextEvent2;
1909
1873
  exports.resolveCompoundSlots = resolveCompoundSlots;
1910
1874
  exports.svgs = svgs;