@digital-b2c/coreui-kit 0.17.18 → 0.17.20

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
@@ -3295,39 +3295,18 @@ var NavigationCtas = ({
3295
3295
  // src/widgets/Navigation/NavigationBrandBars.module.scss
3296
3296
  var NavigationBrandBars_module_default = {
3297
3297
  brandBars: "NavigationBrandBars_module_brandBars",
3298
- brandBar: "NavigationBrandBars_module_brandBar",
3299
- brandBarsUnfolded: "NavigationBrandBars_module_brandBarsUnfolded",
3300
- brandLogo: "NavigationBrandBars_module_brandLogo",
3301
- lenscrafters: "NavigationBrandBars_module_lenscrafters",
3302
- forEyes: "NavigationBrandBars_module_forEyes",
3303
- optical: "NavigationBrandBars_module_optical",
3304
- pearleVision: "NavigationBrandBars_module_pearleVision"
3305
- };
3306
- var BRANDS = [
3307
- { key: "lenscrafters", className: NavigationBrandBars_module_default.lenscrafters, label: "LensCrafters" },
3308
- { key: "forEyes", className: NavigationBrandBars_module_default.forEyes, label: "For Eyes" },
3309
- { key: "optical", className: NavigationBrandBars_module_default.optical, label: "Target Optical" },
3310
- { key: "pearleVision", className: NavigationBrandBars_module_default.pearleVision, label: "Pearle Vision" }
3311
- ];
3312
- var NavigationBrandBars = ({
3313
- brandLogos,
3314
- unfolded = false,
3315
- className
3316
- }) => {
3317
- const hasLogos = !!brandLogos;
3318
- const isUnfolded = hasLogos && unfolded;
3319
- return /* @__PURE__ */ jsxRuntime.jsx(
3320
- "div",
3298
+ brandBar: "NavigationBrandBars_module_brandBar"
3299
+ };
3300
+ var NavigationBrandBars = ({ brandBars, className }) => {
3301
+ if ((brandBars == null ? void 0 : brandBars.length) === 0) return;
3302
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx49__default.default(NavigationBrandBars_module_default.brandBars, className), "aria-hidden": "true", children: brandBars && brandBars.map((bar, index) => /* @__PURE__ */ jsxRuntime.jsx(
3303
+ "span",
3321
3304
  {
3322
- className: clsx49__default.default(NavigationBrandBars_module_default.brandBars, isUnfolded && NavigationBrandBars_module_default.brandBarsUnfolded, className),
3323
- "aria-hidden": "true",
3324
- children: BRANDS.map((brand) => {
3325
- var _a;
3326
- const logo = brandLogos == null ? void 0 : brandLogos[brand.key];
3327
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx49__default.default(NavigationBrandBars_module_default.brandBar, brand.className), children: logo && /* @__PURE__ */ jsxRuntime.jsx("img", { className: NavigationBrandBars_module_default.brandLogo, src: logo.src, alt: (_a = logo.alt) != null ? _a : brand.label }) }, brand.key);
3328
- })
3329
- }
3330
- );
3305
+ className: NavigationBrandBars_module_default.brandBar,
3306
+ style: { backgroundColor: bar.backgroundColor }
3307
+ },
3308
+ `${bar.backgroundColor}-${index}`
3309
+ )) });
3331
3310
  };
3332
3311
  var getPathname = () => typeof window === "undefined" ? "" : window.location.pathname;
3333
3312
  var useActivePath = () => {
@@ -3574,7 +3553,7 @@ var NavigationMobile = ({
3574
3553
  searchPlaceholder,
3575
3554
  searchCta,
3576
3555
  onSearch,
3577
- brandLogos,
3556
+ brandBars,
3578
3557
  isOpen,
3579
3558
  onClose,
3580
3559
  isExternal = false,
@@ -3729,14 +3708,7 @@ var NavigationMobile = ({
3729
3708
  }
3730
3709
  )
3731
3710
  ] }),
3732
- /* @__PURE__ */ jsxRuntime.jsx(
3733
- NavigationBrandBars,
3734
- {
3735
- brandLogos,
3736
- unfolded: false,
3737
- className: NavigationMobile_module_default.mobileBrandBars
3738
- }
3739
- ),
3711
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationBrandBars, { brandBars, className: NavigationMobile_module_default.mobileBrandBars }),
3740
3712
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: NavigationMobile_module_default.mobileItems, children: navItems == null ? void 0 : navItems.map((item, index) => {
3741
3713
  var _a, _b, _c, _d;
3742
3714
  const subMenuId = `${baseId}-submenu-${index}`;
@@ -3864,7 +3836,7 @@ var Navigation2 = (props) => {
3864
3836
  searchPlaceholder = "Search resources",
3865
3837
  searchCta,
3866
3838
  onSearch,
3867
- brandLogos
3839
+ brandBars
3868
3840
  } = props;
3869
3841
  const isExternal = variant !== "internal";
3870
3842
  const slots = resolveCompoundSlots(props.children, {
@@ -3884,7 +3856,6 @@ var Navigation2 = (props) => {
3884
3856
  const dropdownOpen = openIndex !== null && !isTabletBelow;
3885
3857
  const isTransparent = !!transparent && isAtTop && !isHovered && !dropdownOpen;
3886
3858
  const openItem = openIndex !== null ? (_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a[openIndex] : void 0;
3887
- const showLogoUnfolded = !!brandLogos && isAtTop && !dropdownOpen;
3888
3859
  const openDropdown = (index) => {
3889
3860
  if (closeTimer.current) clearTimeout(closeTimer.current);
3890
3861
  setOpenIndex(index);
@@ -4040,13 +4011,7 @@ var Navigation2 = (props) => {
4040
4011
  )
4041
4012
  ] })
4042
4013
  ] }) }),
4043
- !isExternal && /* @__PURE__ */ jsxRuntime.jsx(
4044
- NavigationBrandBars,
4045
- {
4046
- brandLogos,
4047
- unfolded: showLogoUnfolded && !isMobileMenuOpen
4048
- }
4049
- ),
4014
+ !isExternal && /* @__PURE__ */ jsxRuntime.jsx(NavigationBrandBars, { brandBars }),
4050
4015
  dropdownOpen && (openItem == null ? void 0 : openItem.type) === "dropdown" && /* @__PURE__ */ jsxRuntime.jsx(
4051
4016
  NavigationDropdown,
4052
4017
  {
@@ -4075,7 +4040,7 @@ var Navigation2 = (props) => {
4075
4040
  searchPlaceholder,
4076
4041
  searchCta,
4077
4042
  onSearch,
4078
- brandLogos,
4043
+ brandBars,
4079
4044
  isOpen: isMobileMenuOpen,
4080
4045
  onClose: () => setIsMobileMenuOpen(false),
4081
4046
  isExternal,