optimized-react-component-library-xyz123 2.8.5 → 2.8.6

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.js CHANGED
@@ -3802,8 +3802,8 @@ var Navigation = ({
3802
3802
  activatedLanguage = "sv",
3803
3803
  menuLinks = [],
3804
3804
  openButtonRef = null,
3805
- linkComponent: LinkComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("a", { ...props }),
3806
- setKeyboardNavigationClose
3805
+ linkComponent: LinkComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("a", { ...props })
3806
+ //setKeyboardNavigationClose,
3807
3807
  }) => {
3808
3808
  const closeMenuText = activatedLanguage === "sv" ? "St\xE4ng meny" : "Close menu";
3809
3809
  const navRef = (0, import_react16.useRef)(null);
@@ -3811,8 +3811,10 @@ var Navigation = ({
3811
3811
  const handleSubMenu = (label) => {
3812
3812
  setOpenSubMenu(openSubMenu === label ? null : label);
3813
3813
  };
3814
- const handleCloseButton = () => {
3814
+ const handleCloseButton = (type) => {
3815
+ var _a, _b;
3815
3816
  setIsMenyOpen && setIsMenyOpen(false);
3817
+ type === "close" ? (_a = openButtonRef == null ? void 0 : openButtonRef.current) == null ? void 0 : _a.focus() : (_b = document.getElementById("page-start")) == null ? void 0 : _b.focus();
3816
3818
  };
3817
3819
  (0, import_react16.useEffect)(() => {
3818
3820
  if (!isOpen || !navRef.current) return;
@@ -3875,7 +3877,7 @@ var Navigation = ({
3875
3877
  "button",
3876
3878
  {
3877
3879
  className: "pts-navigation-close-button",
3878
- onClick: handleCloseButton,
3880
+ onClick: () => handleCloseButton("close"),
3879
3881
  type: "button",
3880
3882
  children: [
3881
3883
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CloseIcon, {}) }),
@@ -3894,7 +3896,7 @@ var Navigation = ({
3894
3896
  LinkComponent,
3895
3897
  {
3896
3898
  onClick: () => {
3897
- handleCloseButton();
3899
+ handleCloseButton("link");
3898
3900
  },
3899
3901
  href,
3900
3902
  children: label[activatedLanguage]
@@ -3926,7 +3928,7 @@ var Navigation = ({
3926
3928
  LinkComponent,
3927
3929
  {
3928
3930
  onClick: () => {
3929
- handleCloseButton();
3931
+ handleCloseButton("link");
3930
3932
  },
3931
3933
  href: href2,
3932
3934
  children: label2[activatedLanguage]