optimized-react-component-library-xyz123 2.10.1 → 2.10.2
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 +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3881,7 +3881,8 @@ var Navigation = ({
|
|
|
3881
3881
|
menuLinks = [],
|
|
3882
3882
|
openButtonRef = null,
|
|
3883
3883
|
linkComponent: LinkComponent = (props) => /* @__PURE__ */ jsx30("a", { ...props }),
|
|
3884
|
-
navigationCloseFocusId
|
|
3884
|
+
navigationCloseFocusId,
|
|
3885
|
+
activeSubMenu = null
|
|
3885
3886
|
}) => {
|
|
3886
3887
|
const closeMenuText = activatedLanguage === "sv" ? "St\xE4ng meny" : "Close menu";
|
|
3887
3888
|
const navRef = useRef3(null);
|
|
@@ -3896,7 +3897,11 @@ var Navigation = ({
|
|
|
3896
3897
|
typeOfInteraction === "close" ? (_a = openButtonRef == null ? void 0 : openButtonRef.current) == null ? void 0 : _a.focus() : navigationCloseFocusId && ((_b = document.getElementById(navigationCloseFocusId)) == null ? void 0 : _b.focus());
|
|
3897
3898
|
};
|
|
3898
3899
|
useEffect13(() => {
|
|
3899
|
-
if (!isOpen || !navRef.current)
|
|
3900
|
+
if (!isOpen || !navRef.current) {
|
|
3901
|
+
setOpenSubMenu(activeSubMenu);
|
|
3902
|
+
return;
|
|
3903
|
+
}
|
|
3904
|
+
setOpenSubMenu(activeSubMenu);
|
|
3900
3905
|
const nav = navRef.current;
|
|
3901
3906
|
const focusableSelectors = 'a, button, input, textarea, select, [tabindex]:not([tabindex="-1"])';
|
|
3902
3907
|
const focusableElements = nav.querySelectorAll(focusableSelectors);
|
|
@@ -3956,6 +3961,7 @@ var Navigation = ({
|
|
|
3956
3961
|
);
|
|
3957
3962
|
});
|
|
3958
3963
|
}, [isOpen, activatedLanguage]);
|
|
3964
|
+
console.log(openSubMenu);
|
|
3959
3965
|
return /* @__PURE__ */ jsxs26(Fragment20, { children: [
|
|
3960
3966
|
/* @__PURE__ */ jsx30("div", { "aria-live": "polite", className: "sr-only", children: instruction }),
|
|
3961
3967
|
/* @__PURE__ */ jsxs26(
|
|
@@ -4101,7 +4107,8 @@ var NavigationHeader = ({
|
|
|
4101
4107
|
},
|
|
4102
4108
|
linkComponent: LinkComponent = (props) => /* @__PURE__ */ jsx33("a", { ...props }),
|
|
4103
4109
|
noLogoLink = false,
|
|
4104
|
-
navigationCloseFocusId
|
|
4110
|
+
navigationCloseFocusId,
|
|
4111
|
+
activeSubMenu = null
|
|
4105
4112
|
}) => {
|
|
4106
4113
|
const logoLink = activatedLanguage === "en" ? "https://pts.se/en" : "https://pts.se/";
|
|
4107
4114
|
const hasHeadline = headline && headline.length > 0;
|
|
@@ -4162,7 +4169,7 @@ var NavigationHeader = ({
|
|
|
4162
4169
|
children: /* @__PURE__ */ jsx33("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? /* @__PURE__ */ jsx33(Logo_en, {}) : /* @__PURE__ */ jsx33(Logo_sv, {}) })
|
|
4163
4170
|
}
|
|
4164
4171
|
) }),
|
|
4165
|
-
/* @__PURE__ */ jsx33("div", { className: `${hasHeadline ? "pts-navigation-header-headline-container" : ""}`, children: hasHeadline && /* @__PURE__ */ jsx33("
|
|
4172
|
+
/* @__PURE__ */ jsx33("div", { className: `${hasHeadline ? "pts-navigation-header-headline-container" : ""}`, children: hasHeadline && /* @__PURE__ */ jsx33("div", { className: "pts-site-headline", children: headline }) }),
|
|
4166
4173
|
/* @__PURE__ */ jsx33("div", { className: "pts-navigation-header-nav-container", children: (useLanguage || useNavigationMenu || useSearch) && /* @__PURE__ */ jsxs29(Fragment21, { children: [
|
|
4167
4174
|
useSearch && !isMenuOpen && /* @__PURE__ */ jsx33(Fragment21, { children: /* @__PURE__ */ jsxs29("button", { type: "button", onClick: handleSearchClick, children: [
|
|
4168
4175
|
/* @__PURE__ */ jsx33("span", { "aria-hidden": "true", className: "pts-navigation-header-icons", children: getSearchIcon() }),
|
|
@@ -4206,7 +4213,8 @@ var NavigationHeader = ({
|
|
|
4206
4213
|
isOpen: isMenuOpen,
|
|
4207
4214
|
openButtonRef: menuButtonFocusRef,
|
|
4208
4215
|
linkComponent: LinkComponent,
|
|
4209
|
-
navigationCloseFocusId
|
|
4216
|
+
navigationCloseFocusId,
|
|
4217
|
+
activeSubMenu
|
|
4210
4218
|
}
|
|
4211
4219
|
) }),
|
|
4212
4220
|
isMenuOpen && /* @__PURE__ */ jsx33(
|