optimized-react-component-library-xyz123 1.1.15 → 1.1.17

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.mts CHANGED
@@ -1,4 +1,4 @@
1
- import React$1, { ComponentType, SVGProps, FC, RefObject, ReactNode } from 'react';
1
+ import React$1, { ComponentType, SVGProps, FC, ElementType, RefObject, ReactNode } from 'react';
2
2
  import * as reselect from 'reselect';
3
3
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
4
4
  import { PayloadAction, ActionReducerMapBuilder } from '@reduxjs/toolkit';
@@ -802,6 +802,7 @@ interface NavigationHeaderProps {
802
802
  useBreadCrumbs?: boolean;
803
803
  showNavigationCloseButton?: boolean;
804
804
  menuLinks: INavigationItem[];
805
+ linkComponent?: ElementType;
805
806
  }
806
807
 
807
808
  declare const NavigationHeader: FC<NavigationHeaderProps>;
@@ -813,6 +814,7 @@ interface NavigationProps {
813
814
  menuLinks?: INavigationLink[];
814
815
  isOpen: boolean;
815
816
  openButtonRef: RefObject<HTMLButtonElement | null>;
817
+ linkComponent?: ElementType;
816
818
  }
817
819
  type Locale = 'sv' | 'en';
818
820
  type Label = Record<Locale, string>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React$1, { ComponentType, SVGProps, FC, RefObject, ReactNode } from 'react';
1
+ import React$1, { ComponentType, SVGProps, FC, ElementType, RefObject, ReactNode } from 'react';
2
2
  import * as reselect from 'reselect';
3
3
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
4
4
  import { PayloadAction, ActionReducerMapBuilder } from '@reduxjs/toolkit';
@@ -802,6 +802,7 @@ interface NavigationHeaderProps {
802
802
  useBreadCrumbs?: boolean;
803
803
  showNavigationCloseButton?: boolean;
804
804
  menuLinks: INavigationItem[];
805
+ linkComponent?: ElementType;
805
806
  }
806
807
 
807
808
  declare const NavigationHeader: FC<NavigationHeaderProps>;
@@ -813,6 +814,7 @@ interface NavigationProps {
813
814
  menuLinks?: INavigationLink[];
814
815
  isOpen: boolean;
815
816
  openButtonRef: RefObject<HTMLButtonElement | null>;
817
+ linkComponent?: ElementType;
816
818
  }
817
819
  type Locale = 'sv' | 'en';
818
820
  type Label = Record<Locale, string>;
package/dist/index.js CHANGED
@@ -3298,7 +3298,8 @@ var Navigation = ({
3298
3298
  activatedLanguage = "sv",
3299
3299
  menuLinks = [],
3300
3300
  showCloseButton = true,
3301
- openButtonRef = null
3301
+ openButtonRef = null,
3302
+ linkComponent: LinkComponent = "a"
3302
3303
  }) => {
3303
3304
  const closeMenuText = activatedLanguage === "sv" ? "St\xE4ng meny" : "Close menu";
3304
3305
  const [openSubMenu, setOpenSubMenu] = (0, import_react13.useState)(null);
@@ -3350,7 +3351,7 @@ var Navigation = ({
3350
3351
  className: `pts-navigation-link ${openSubMenu === label[activatedLanguage] ? "open" : ""}`,
3351
3352
  children: [
3352
3353
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "pts-navigation-button", children: [
3353
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: href.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: label[activatedLanguage] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("a", { onClick: handleCloseButton, href, children: label[activatedLanguage] }) }),
3354
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: href.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: label[activatedLanguage] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LinkComponent, { onClick: handleCloseButton, href, children: label[activatedLanguage] }) }),
3354
3355
  children && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3355
3356
  "button",
3356
3357
  {
@@ -3369,7 +3370,7 @@ var Navigation = ({
3369
3370
  hidden: openSubMenu !== label[activatedLanguage],
3370
3371
  className: "pts-sub-navigation-container",
3371
3372
  id: "sub-menu-" + index,
3372
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "pts-sub-navigation-list", children: children.map(({ label: label2, href: href2 }, index2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("li", { className: "pts-sub-navigation-item", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("a", { onClick: handleCloseButton, href: href2, children: label2[activatedLanguage] }) }, "nav-child-" + index2)) })
3373
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "pts-sub-navigation-list", children: children.map(({ label: label2, href: href2 }, index2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("li", { className: "pts-sub-navigation-item", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LinkComponent, { onClick: handleCloseButton, href: href2, children: label2[activatedLanguage] }) }, "nav-child-" + index2)) })
3373
3374
  }
3374
3375
  )
3375
3376
  ]
@@ -3475,7 +3476,8 @@ var NavigationHeader = ({
3475
3476
  menuLinks = void 0,
3476
3477
  showNavigationCloseButton = false,
3477
3478
  SetActivatedLanguage = () => {
3478
- }
3479
+ },
3480
+ linkComponent: LinkComponent = "a"
3479
3481
  }) => {
3480
3482
  const logoLink = activatedLanguage === "en" ? "https://pts.se/en" : "https://pts.se/";
3481
3483
  const hasHeadline = headline && headline.length > 0;
@@ -3527,7 +3529,7 @@ var NavigationHeader = ({
3527
3529
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
3528
3530
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("header", { className: "pts-navigation-header-container", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "pts-navigation-header-content", children: [
3529
3531
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pts-navigation-header-logo-container", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3530
- "a",
3532
+ LinkComponent,
3531
3533
  {
3532
3534
  className: "pts-navigation-header-logo",
3533
3535
  href: logoLink,
@@ -3587,7 +3589,8 @@ var NavigationHeader = ({
3587
3589
  menuLinks,
3588
3590
  showCloseButton: showNavigationCloseButton != null ? showNavigationCloseButton : true,
3589
3591
  isOpen: isMenuOpen,
3590
- openButtonRef: menuButtonFocusRef
3592
+ openButtonRef: menuButtonFocusRef,
3593
+ linkComponent: LinkComponent
3591
3594
  }
3592
3595
  ),
3593
3596
  !isMenuOpen && isSearchOpen && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SearchBarStandard_default, { activatedLanguage }),