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 +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3719,8 +3719,8 @@ var Navigation = ({
|
|
|
3719
3719
|
activatedLanguage = "sv",
|
|
3720
3720
|
menuLinks = [],
|
|
3721
3721
|
openButtonRef = null,
|
|
3722
|
-
linkComponent: LinkComponent = (props) => /* @__PURE__ */ jsx28("a", { ...props })
|
|
3723
|
-
setKeyboardNavigationClose
|
|
3722
|
+
linkComponent: LinkComponent = (props) => /* @__PURE__ */ jsx28("a", { ...props })
|
|
3723
|
+
//setKeyboardNavigationClose,
|
|
3724
3724
|
}) => {
|
|
3725
3725
|
const closeMenuText = activatedLanguage === "sv" ? "St\xE4ng meny" : "Close menu";
|
|
3726
3726
|
const navRef = useRef3(null);
|
|
@@ -3728,8 +3728,10 @@ var Navigation = ({
|
|
|
3728
3728
|
const handleSubMenu = (label) => {
|
|
3729
3729
|
setOpenSubMenu(openSubMenu === label ? null : label);
|
|
3730
3730
|
};
|
|
3731
|
-
const handleCloseButton = () => {
|
|
3731
|
+
const handleCloseButton = (type) => {
|
|
3732
|
+
var _a, _b;
|
|
3732
3733
|
setIsMenyOpen && setIsMenyOpen(false);
|
|
3734
|
+
type === "close" ? (_a = openButtonRef == null ? void 0 : openButtonRef.current) == null ? void 0 : _a.focus() : (_b = document.getElementById("page-start")) == null ? void 0 : _b.focus();
|
|
3733
3735
|
};
|
|
3734
3736
|
useEffect13(() => {
|
|
3735
3737
|
if (!isOpen || !navRef.current) return;
|
|
@@ -3792,7 +3794,7 @@ var Navigation = ({
|
|
|
3792
3794
|
"button",
|
|
3793
3795
|
{
|
|
3794
3796
|
className: "pts-navigation-close-button",
|
|
3795
|
-
onClick: handleCloseButton,
|
|
3797
|
+
onClick: () => handleCloseButton("close"),
|
|
3796
3798
|
type: "button",
|
|
3797
3799
|
children: [
|
|
3798
3800
|
/* @__PURE__ */ jsx28("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx28(CloseIcon, {}) }),
|
|
@@ -3811,7 +3813,7 @@ var Navigation = ({
|
|
|
3811
3813
|
LinkComponent,
|
|
3812
3814
|
{
|
|
3813
3815
|
onClick: () => {
|
|
3814
|
-
handleCloseButton();
|
|
3816
|
+
handleCloseButton("link");
|
|
3815
3817
|
},
|
|
3816
3818
|
href,
|
|
3817
3819
|
children: label[activatedLanguage]
|
|
@@ -3843,7 +3845,7 @@ var Navigation = ({
|
|
|
3843
3845
|
LinkComponent,
|
|
3844
3846
|
{
|
|
3845
3847
|
onClick: () => {
|
|
3846
|
-
handleCloseButton();
|
|
3848
|
+
handleCloseButton("link");
|
|
3847
3849
|
},
|
|
3848
3850
|
href: href2,
|
|
3849
3851
|
children: label2[activatedLanguage]
|