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

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, RefObject, ElementType, 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';
@@ -813,6 +813,7 @@ interface NavigationProps {
813
813
  menuLinks?: INavigationLink[];
814
814
  isOpen: boolean;
815
815
  openButtonRef: RefObject<HTMLButtonElement | null>;
816
+ linkComponent?: ElementType;
816
817
  }
817
818
  type Locale = 'sv' | 'en';
818
819
  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, RefObject, ElementType, 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';
@@ -813,6 +813,7 @@ interface NavigationProps {
813
813
  menuLinks?: INavigationLink[];
814
814
  isOpen: boolean;
815
815
  openButtonRef: RefObject<HTMLButtonElement | null>;
816
+ linkComponent?: ElementType;
816
817
  }
817
818
  type Locale = 'sv' | 'en';
818
819
  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
  ]