@digital-b2c/coreui-kit 0.15.0 → 0.15.1

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.cjs CHANGED
@@ -3175,7 +3175,7 @@ var useIsAtTop = () => {
3175
3175
 
3176
3176
  // src/widgets/Navigation/Navigation.module.scss
3177
3177
  var Navigation_module_default = {
3178
- internalDropdownTitle: "Navigation_module_internalDropdownTitle",
3178
+ dropdownTitle: "Navigation_module_dropdownTitle",
3179
3179
  mobileItemLink: "Navigation_module_mobileItemLink",
3180
3180
  mobileItemTrigger: "Navigation_module_mobileItemTrigger",
3181
3181
  mobileSubLink: "Navigation_module_mobileSubLink",
@@ -3203,6 +3203,7 @@ var Navigation_module_default = {
3203
3203
  Navigation: "Navigation_module_Navigation",
3204
3204
  mainBar: "Navigation_module_mainBar",
3205
3205
  navTabLink: "Navigation_module_navTabLink",
3206
+ navTabActive: "Navigation_module_navTabActive",
3206
3207
  inner: "Navigation_module_inner",
3207
3208
  topRow: "Navigation_module_topRow",
3208
3209
  logoLink: "Navigation_module_logoLink",
@@ -3213,15 +3214,14 @@ var Navigation_module_default = {
3213
3214
  navTab: "Navigation_module_navTab",
3214
3215
  navTabTrigger: "Navigation_module_navTabTrigger",
3215
3216
  navTabTriggerOpen: "Navigation_module_navTabTriggerOpen",
3216
- navTabActive: "Navigation_module_navTabActive",
3217
- internalDropdownPanel: "Navigation_module_internalDropdownPanel",
3218
- internalDropdownInner: "Navigation_module_internalDropdownInner",
3219
- internalDropdownLinks: "Navigation_module_internalDropdownLinks",
3217
+ dropdownPanel: "Navigation_module_dropdownPanel",
3218
+ dropdownInner: "Navigation_module_dropdownInner",
3219
+ dropdownLinks: "Navigation_module_dropdownLinks",
3220
3220
  dropdownLinkItem: "Navigation_module_dropdownLinkItem",
3221
- internalDropdownLink: "Navigation_module_internalDropdownLink",
3221
+ dropdownLink: "Navigation_module_dropdownLink",
3222
3222
  dropdownDivider: "Navigation_module_dropdownDivider",
3223
- internalDropdownInfo: "Navigation_module_internalDropdownInfo",
3224
- internalDropdownDescription: "Navigation_module_internalDropdownDescription",
3223
+ dropdownInfo: "Navigation_module_dropdownInfo",
3224
+ dropdownDescription: "Navigation_module_dropdownDescription",
3225
3225
  brandBars: "Navigation_module_brandBars",
3226
3226
  brandBar: "Navigation_module_brandBar",
3227
3227
  brandBarsUnfolded: "Navigation_module_brandBarsUnfolded",
@@ -3411,11 +3411,11 @@ var NavigationDropdown = ({
3411
3411
  "div",
3412
3412
  {
3413
3413
  id: panelId,
3414
- className: clsx47__default.default(Navigation_module_default.internalDropdownPanel, Navigation_module_default.internalDropdownPanelOpen),
3414
+ className: clsx47__default.default(Navigation_module_default.dropdownPanel, Navigation_module_default.dropdownPanelOpen),
3415
3415
  onMouseEnter,
3416
3416
  onMouseLeave,
3417
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.internalDropdownInner, children: [
3418
- /* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.internalDropdownLinks, children: links.map((sub, i) => {
3417
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.dropdownInner, children: [
3418
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.dropdownLinks, children: links.map((sub, i) => {
3419
3419
  var _a, _b, _c, _d;
3420
3420
  return /* @__PURE__ */ jsxRuntime.jsx(
3421
3421
  "li",
@@ -3427,7 +3427,7 @@ var NavigationDropdown = ({
3427
3427
  "a",
3428
3428
  {
3429
3429
  href: (_a = sub.cta) == null ? void 0 : _a.url,
3430
- className: Navigation_module_default.internalDropdownLink,
3430
+ className: Navigation_module_default.dropdownLink,
3431
3431
  target: ((_b = sub.cta) == null ? void 0 : _b.isExternal) ? "_blank" : void 0,
3432
3432
  rel: ((_c = sub.cta) == null ? void 0 : _c.isExternal) ? "noopener noreferrer" : void 0,
3433
3433
  onKeyDown: (e) => handleLinkKeyDown(e, i === 0, i === links.length - 1),
@@ -3439,9 +3439,9 @@ var NavigationDropdown = ({
3439
3439
  );
3440
3440
  }) }),
3441
3441
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: Navigation_module_default.dropdownDivider, "aria-hidden": "true" }),
3442
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.internalDropdownInfo, children: [
3443
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: Navigation_module_default.internalDropdownTitle, children: title }),
3444
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: Navigation_module_default.internalDropdownDescription, children: description })
3442
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.dropdownInfo, children: [
3443
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: Navigation_module_default.dropdownTitle, children: title }),
3444
+ description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Navigation_module_default.dropdownDescription, children: description })
3445
3445
  ] })
3446
3446
  ] })
3447
3447
  }
@@ -3468,6 +3468,20 @@ var NavigationMobile = ({
3468
3468
  const toggleExpanded = (index) => {
3469
3469
  setExpanded((prev) => prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]);
3470
3470
  };
3471
+ const expandItem = (index) => {
3472
+ setExpanded((prev) => prev.includes(index) ? prev : [...prev, index]);
3473
+ };
3474
+ const collapseItem = (index) => {
3475
+ setExpanded((prev) => prev.filter((i) => i !== index));
3476
+ };
3477
+ const hoverFocusProps = (index) => ({
3478
+ onMouseEnter: () => expandItem(index),
3479
+ onMouseLeave: () => collapseItem(index),
3480
+ onFocus: () => expandItem(index),
3481
+ onBlur: (e) => {
3482
+ if (!e.currentTarget.contains(e.relatedTarget)) collapseItem(index);
3483
+ }
3484
+ });
3471
3485
  const logo = mainLogo ? /* @__PURE__ */ jsxRuntime.jsx(Picture, { className: Navigation_module_default.logoMobile, src: mainLogo, alt: logoAlt }) : null;
3472
3486
  if (isExternal) {
3473
3487
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3506,7 +3520,7 @@ var NavigationMobile = ({
3506
3520
  var _a, _b;
3507
3521
  const subMenuId = `${baseId}-submenu-${index}`;
3508
3522
  const isExpanded = expanded.includes(index);
3509
- return item.type === "dropdown" ? /* @__PURE__ */ jsxRuntime.jsxs("li", { className: Navigation_module_default.mobileItem, children: [
3523
+ return item.type === "dropdown" ? /* @__PURE__ */ jsxRuntime.jsxs("li", __spreadProps(__spreadValues({ className: Navigation_module_default.mobileItem }, hoverFocusProps(index)), { children: [
3510
3524
  /* @__PURE__ */ jsxRuntime.jsxs(
3511
3525
  "button",
3512
3526
  {
@@ -3552,7 +3566,7 @@ var NavigationMobile = ({
3552
3566
  ) })
3553
3567
  }
3554
3568
  )
3555
- ] }, index) : /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: (_a = item.cta) == null ? void 0 : _a.url, className: Navigation_module_default.mobileItemLink, onClick: onClose, children: (_b = item.cta) == null ? void 0 : _b.label }) }, index);
3569
+ ] }), index) : /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: (_a = item.cta) == null ? void 0 : _a.url, className: Navigation_module_default.mobileItemLink, onClick: onClose, children: (_b = item.cta) == null ? void 0 : _b.label }) }, index);
3556
3570
  }) }),
3557
3571
  /* @__PURE__ */ jsxRuntime.jsx(
3558
3572
  NavigationCtas,
@@ -3614,7 +3628,7 @@ var NavigationMobile = ({
3614
3628
  }
3615
3629
  ) }, index);
3616
3630
  }
3617
- return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: Navigation_module_default.internalMobileItem, children: [
3631
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", __spreadProps(__spreadValues({ className: Navigation_module_default.internalMobileItem }, hoverFocusProps(index)), { children: [
3618
3632
  /* @__PURE__ */ jsxRuntime.jsxs(
3619
3633
  "button",
3620
3634
  {
@@ -3665,7 +3679,7 @@ var NavigationMobile = ({
3665
3679
  ) })
3666
3680
  }
3667
3681
  )
3668
- ] }, index);
3682
+ ] }), index);
3669
3683
  }) }),
3670
3684
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.mobileFooter, children: [
3671
3685
  /* @__PURE__ */ jsxRuntime.jsx(