optimized-react-component-library-xyz123 2.8.7 → 2.8.8

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
@@ -3872,6 +3872,7 @@ var Navigation = ({
3872
3872
  "aria-label": activatedLanguage === "sv" ? "Huvudnavigation" : "Main navigation",
3873
3873
  className: `pts-navigation-menu-container ${isOpen ? "open" : ""}`,
3874
3874
  inert: !isOpen,
3875
+ "aria-expanded": isOpen,
3875
3876
  children: [
3876
3877
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "pts-navigation-close-container ", id: "menu-close", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3877
3878
  "button",
@@ -3895,9 +3896,7 @@ var Navigation = ({
3895
3896
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: href && href.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: label[activatedLanguage] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3896
3897
  LinkComponent,
3897
3898
  {
3898
- onClick: () => {
3899
- handleMenuClick("link");
3900
- },
3899
+ onClick: () => handleMenuClick("link"),
3901
3900
  href,
3902
3901
  children: label[activatedLanguage]
3903
3902
  }
@@ -3927,9 +3926,7 @@ var Navigation = ({
3927
3926
  children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("ul", { className: "pts-sub-navigation-list", lang: activatedLanguage, children: children.map(({ label: label2, href: href2 }, index2) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("li", { className: "pts-sub-navigation-item", lang: activatedLanguage, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3928
3927
  LinkComponent,
3929
3928
  {
3930
- onClick: () => {
3931
- handleMenuClick("link");
3932
- },
3929
+ onClick: () => handleMenuClick("link"),
3933
3930
  href: href2,
3934
3931
  children: label2[activatedLanguage]
3935
3932
  }
@@ -4025,24 +4022,10 @@ var NavigationHeader = ({
4025
4022
  else return "Svenska";
4026
4023
  };
4027
4024
  const [isMenuOpen, setIsMenuOpen] = (0, import_react18.useState)(false);
4028
- const [hasBeenOpen, setHasBeenOpen] = (0, import_react18.useState)(false);
4029
4025
  const menuButtonFocusRef = (0, import_react18.useRef)(null);
4030
4026
  const handleMenuClick = () => {
4031
- setIsMenuOpen((prev) => {
4032
- const open = !prev;
4033
- if (open) {
4034
- setHasBeenOpen(true);
4035
- }
4036
- return open;
4037
- });
4027
+ setIsMenuOpen((prev) => !prev);
4038
4028
  };
4039
- const [instruction, setInstruction] = (0, import_react18.useState)("");
4040
- (0, import_react18.useEffect)(() => {
4041
- if (!isMenuOpen)
4042
- return;
4043
- const message = activatedLanguage === "sv" ? "Navigationsmenyn \xF6ppnades" : "Navigation menu opened";
4044
- setInstruction(message);
4045
- }, [isMenuOpen, activatedLanguage]);
4046
4029
  const getMenuLabel = () => {
4047
4030
  const labels = {
4048
4031
  sv: isMenuOpen ? "St\xE4ng meny" : "Meny",
@@ -4119,21 +4102,18 @@ var NavigationHeader = ({
4119
4102
  )
4120
4103
  ] }) })
4121
4104
  ] }) }),
4122
- useNavigationMenu && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4123
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { "aria-live": "polite", className: "sr-only", children: instruction }),
4124
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4125
- NavigationStandard_default,
4126
- {
4127
- activatedLanguage,
4128
- setIsMenyOpen: setIsMenuOpen,
4129
- menuLinks,
4130
- isOpen: isMenuOpen,
4131
- openButtonRef: menuButtonFocusRef,
4132
- linkComponent: LinkComponent,
4133
- navigationCloseFocusId
4134
- }
4135
- )
4136
- ] }),
4105
+ useNavigationMenu && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4106
+ NavigationStandard_default,
4107
+ {
4108
+ activatedLanguage,
4109
+ setIsMenyOpen: setIsMenuOpen,
4110
+ menuLinks,
4111
+ isOpen: isMenuOpen,
4112
+ openButtonRef: menuButtonFocusRef,
4113
+ linkComponent: LinkComponent,
4114
+ navigationCloseFocusId
4115
+ }
4116
+ ) }),
4137
4117
  isMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4138
4118
  "div",
4139
4119
  {