optimized-react-component-library-xyz123 2.14.1 → 2.15.1

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
@@ -823,6 +823,8 @@ declare const CookieBanner: React$1.FC<CookieBannerProps>;
823
823
 
824
824
  interface FooterProps {
825
825
  activatedLanguage?: string;
826
+ appUsesCookies?: boolean;
827
+ openCookieBanner?: () => void;
826
828
  }
827
829
 
828
830
  declare const Footer: FC<FooterProps>;
package/dist/index.d.ts CHANGED
@@ -823,6 +823,8 @@ declare const CookieBanner: React$1.FC<CookieBannerProps>;
823
823
 
824
824
  interface FooterProps {
825
825
  activatedLanguage?: string;
826
+ appUsesCookies?: boolean;
827
+ openCookieBanner?: () => void;
826
828
  }
827
829
 
828
830
  declare const Footer: FC<FooterProps>;
package/dist/index.js CHANGED
@@ -1410,6 +1410,7 @@ __export(icons_exports, {
1410
1410
  ChevronRightIcon: () => ChevronRightIcon,
1411
1411
  CloseIcon: () => CloseIcon,
1412
1412
  CollapseIcon: () => CollapseIcon,
1413
+ Cookie_icon: () => Cookie_icon,
1413
1414
  ExpandIcon: () => ExpandIcon,
1414
1415
  FileIcon: () => FileIcon,
1415
1416
  LanguageIcon: () => LanguageIcon,
@@ -1995,6 +1996,13 @@ var Logo_en = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1995
1996
  ]
1996
1997
  }
1997
1998
  );
1999
+ var Cookie_icon = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "13", height: "16", viewBox: "0 0 13 16", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2000
+ "path",
2001
+ {
2002
+ d: "M4.67907 11.2981H8.32186C8.53419 11.2981 8.71217 11.228 8.85579 11.0878C8.9994 10.9476 9.07121 10.7736 9.07121 10.5658V7.91662C9.07121 7.70938 8.9994 7.53567 8.85579 7.39549C8.71217 7.25532 8.53388 7.18523 8.32093 7.18523H8.16029V6.27892C8.16029 5.82637 8.00243 5.44572 7.68671 5.13697C7.371 4.82882 6.98131 4.67475 6.51764 4.67475C6.05398 4.67475 5.66429 4.82882 5.34857 5.13697C5.03286 5.44511 4.875 5.82576 4.875 6.27892V7.18523H4.67814C4.46581 7.18523 4.28783 7.25532 4.14421 7.39549C4.0006 7.53567 3.92879 7.70938 3.92879 7.91662V10.5658C3.92879 10.7736 4.0006 10.9476 4.14421 11.0878C4.28783 11.228 4.46612 11.2981 4.67907 11.2981ZM5.58907 7.18523V6.27892C5.58907 6.02213 5.67821 5.80673 5.8565 5.63272C6.03479 5.45871 6.25517 5.3717 6.51764 5.3717C6.78012 5.3717 7.00081 5.45871 7.17971 5.63272C7.35862 5.80673 7.44745 6.02213 7.44621 6.27892V7.18523H5.58907ZM6.2335 15.9773C6.14064 15.9622 6.05398 15.9396 5.9735 15.9094C4.14607 15.2296 2.69379 14.0768 1.61664 12.4509C0.5395 10.825 0.000619048 9.06491 0 7.17073V3.289C0 2.97844 0.0906907 2.69869 0.272072 2.44976C0.452834 2.20082 0.687143 2.02047 0.975 1.90869L5.97536 0.0960688C6.15612 0.0320229 6.331 0 6.5 0C6.669 0 6.84419 0.0320229 7.02557 0.0960688L12.025 1.90869C12.3122 2.02107 12.5465 2.20143 12.7279 2.44976C12.9093 2.69869 13 2.97844 13 3.289V7.17073C13 9.06491 12.4614 10.825 11.3843 12.4509C10.3071 14.0768 8.85486 15.2296 7.02743 15.9094C6.94633 15.9396 6.85936 15.9622 6.7665 15.9773C6.67364 15.9924 6.58481 16 6.5 16C6.41519 16 6.32636 15.9924 6.2335 15.9773ZM6.5 15.1463C8.10952 14.6478 9.44048 13.6508 10.4929 12.1554C11.5452 10.66 12.0714 8.99845 12.0714 7.17073V3.27178C12.0714 3.15577 12.0386 3.05124 11.973 2.9582C11.908 2.86515 11.8158 2.79567 11.6963 2.74975L6.69686 0.937125C6.63743 0.912957 6.57181 0.900873 6.5 0.900873C6.42819 0.900873 6.36257 0.912957 6.30314 0.937125L1.30371 2.74975C1.18424 2.79567 1.092 2.86515 1.027 2.9582C0.961381 3.05124 0.928571 3.15577 0.928571 3.27178V7.17073C0.928571 8.99845 1.45476 10.66 2.50714 12.1554C3.55952 13.6508 4.89048 14.6478 6.5 15.1463Z",
2003
+ fill: "white"
2004
+ }
2005
+ ) });
1998
2006
 
1999
2007
  // src/components/layout/AlertInTextStandard/AlertInTextStandard.tsx
2000
2008
  var import_dompurify5 = __toESM(require("dompurify"));
@@ -3469,7 +3477,11 @@ var CookieBanner_default = CookieBanner;
3469
3477
 
3470
3478
  // src/components/layout/FooterStandard/FooterStandard.tsx
3471
3479
  var import_jsx_runtime27 = require("react/jsx-runtime");
3472
- var Footer = ({ activatedLanguage = "sv" }) => {
3480
+ var Footer = ({
3481
+ activatedLanguage = "sv",
3482
+ appUsesCookies = false,
3483
+ openCookieBanner
3484
+ }) => {
3473
3485
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("footer", { className: "pts-footer-container", children: [
3474
3486
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "pts-footer-slogan-text-container", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "pts-footer-slogan-text", children: activatedLanguage === "sv" ? "S\xE4ker och tillg\xE4nglig kommunikation f\xF6r Sverige" : "Secure and accessible communication for Sweden" }) }),
3475
3487
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "pts-footer-content", children: [
@@ -3538,7 +3550,20 @@ var Footer = ({ activatedLanguage = "sv" }) => {
3538
3550
  ]
3539
3551
  }
3540
3552
  ) }),
3541
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3553
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { children: appUsesCookies ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3554
+ "button",
3555
+ {
3556
+ type: "button",
3557
+ "aria-controls": "cookie-banner",
3558
+ onClick: openCookieBanner,
3559
+ className: "pts-footer-button pts-secondary-button",
3560
+ children: [
3561
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Cookies (opens cookie banner)" : "PTS Kakor (\xF6ppnar kakbanner)" }),
3562
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "aria-hidden": "true", className: "secondary_icon", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Cookie_icon, {}) }),
3563
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Cookies" : "Kakor" })
3564
+ ]
3565
+ }
3566
+ ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3542
3567
  "a",
3543
3568
  {
3544
3569
  href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",
@@ -3968,7 +3993,7 @@ var Header = ({
3968
3993
  "button",
3969
3994
  {
3970
3995
  lang: activatedLanguage === "en" ? "en" : "sv",
3971
- className: "pts-languageButton",
3996
+ className: "pts-languageButton pts-secondary-button",
3972
3997
  onClick: handleLanguageClick,
3973
3998
  children: [
3974
3999
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "languageIcon", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LanguageIcon2, {}) }) }),
@@ -4016,12 +4041,10 @@ var Navigation = ({
4016
4041
  setOpenSubMenu(null);
4017
4042
  return;
4018
4043
  }
4019
- const defaultOpenSubMenu = activePath == null ? null : (_b = (_a = menuLinks.find(
4020
- (link) => {
4021
- var _a2;
4022
- return (_a2 = link.children) == null ? void 0 : _a2.some((child) => child.href.includes(activePath));
4023
- }
4024
- )) == null ? void 0 : _a.label[activatedLanguage]) != null ? _b : null;
4044
+ const defaultOpenSubMenu = activePath == null ? null : (_b = (_a = menuLinks.find((link) => {
4045
+ var _a2;
4046
+ return (_a2 = link.children) == null ? void 0 : _a2.some((child) => child.href.includes(activePath));
4047
+ })) == null ? void 0 : _a.label[activatedLanguage]) != null ? _b : null;
4025
4048
  setOpenSubMenu(defaultOpenSubMenu);
4026
4049
  }, [isOpen, activePath, menuLinks, activatedLanguage]);
4027
4050
  (0, import_react16.useEffect)(() => {
@@ -4102,7 +4125,7 @@ var Navigation = ({
4102
4125
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "pts-navigation-close-container ", id: "menu-close", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
4103
4126
  "button",
4104
4127
  {
4105
- className: "pts-navigation-close-button",
4128
+ className: "pts-navigation-close-button pts-secondary-button",
4106
4129
  onClick: () => handleMenuClick("close"),
4107
4130
  type: "button",
4108
4131
  children: [
@@ -4118,14 +4141,7 @@ var Navigation = ({
4118
4141
  lang: activatedLanguage,
4119
4142
  children: [
4120
4143
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "pts-navigation-button", children: [
4121
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: href && href.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: label[activatedLanguage] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4122
- LinkComponent,
4123
- {
4124
- onClick: () => handleMenuClick("link"),
4125
- href,
4126
- children: label[activatedLanguage]
4127
- }
4128
- ) }),
4144
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: href && href.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: label[activatedLanguage] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LinkComponent, { onClick: () => handleMenuClick("link"), href, children: label[activatedLanguage] }) }),
4129
4145
  children && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4130
4146
  "button",
4131
4147
  {
@@ -4148,14 +4164,15 @@ var Navigation = ({
4148
4164
  className: "pts-sub-navigation-container",
4149
4165
  id: "sub-menu-" + index,
4150
4166
  role: "region",
4151
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { className: "pts-sub-navigation-list", lang: activatedLanguage, children: children.map(({ label: label2, href: href2 }, index2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("li", { className: "pts-sub-navigation-item", lang: activatedLanguage, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4152
- LinkComponent,
4167
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { className: "pts-sub-navigation-list", lang: activatedLanguage, children: children.map(({ label: label2, href: href2 }, index2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4168
+ "li",
4153
4169
  {
4154
- onClick: () => handleMenuClick("link"),
4155
- href: href2,
4156
- children: label2[activatedLanguage]
4157
- }
4158
- ) }, "nav-child-" + index2)) })
4170
+ className: "pts-sub-navigation-item",
4171
+ lang: activatedLanguage,
4172
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LinkComponent, { onClick: () => handleMenuClick("link"), href: href2, children: label2[activatedLanguage] })
4173
+ },
4174
+ "nav-child-" + index2
4175
+ )) })
4159
4176
  }
4160
4177
  )
4161
4178
  ]
@@ -4222,7 +4239,7 @@ var import_jsx_runtime33 = require("react/jsx-runtime");
4222
4239
  var NavigationHeader = ({
4223
4240
  headline = void 0,
4224
4241
  homelink = "",
4225
- //??
4242
+ //??
4226
4243
  activatedLanguage = "sv",
4227
4244
  useLanguage = false,
4228
4245
  useNavigationMenu = true,
@@ -4296,14 +4313,23 @@ var NavigationHeader = ({
4296
4313
  ) }),
4297
4314
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `${hasHeadline ? "pts-navigation-header-headline-container" : ""}`, children: hasHeadline && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "pts-site-headline", children: headline }) }),
4298
4315
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "pts-navigation-header-nav-container", children: (useLanguage || useNavigationMenu || useSearch) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
4299
- useSearch && !isMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", onClick: handleSearchClick, children: [
4300
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true", className: "pts-navigation-header-icons", children: getSearchIcon() }),
4301
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pts-navigation-header-button-label", children: getSearchLabel() })
4302
- ] }) }),
4316
+ useSearch && !isMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4317
+ "button",
4318
+ {
4319
+ type: "button",
4320
+ className: "pts-secondary-button",
4321
+ onClick: handleSearchClick,
4322
+ children: [
4323
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true", className: "pts-navigation-header-icons", children: getSearchIcon() }),
4324
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pts-navigation-header-button-label", children: getSearchLabel() })
4325
+ ]
4326
+ }
4327
+ ) }),
4303
4328
  useLanguage && !isMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4304
4329
  "button",
4305
4330
  {
4306
4331
  type: "button",
4332
+ className: "pts-secondary-button",
4307
4333
  lang: activatedLanguage === "en" ? "en" : "sv",
4308
4334
  onClick: handleLanguageClick,
4309
4335
  "aria-label": activatedLanguage === "sv" ? "Change language to English" : "\xC4ndra spr\xE5k till svenska",
@@ -4317,12 +4343,20 @@ var NavigationHeader = ({
4317
4343
  "button",
4318
4344
  {
4319
4345
  type: "button",
4346
+ className: "pts-secondary-button",
4320
4347
  onClick: handleMenuClick,
4321
4348
  "aria-expanded": isMenuOpen,
4322
4349
  "aria-controls": "main-navigation",
4323
4350
  ref: menuButtonFocusRef,
4324
4351
  children: [
4325
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true", className: isMenuOpen ? "pts-close-icon" : "pts-open-icon", children: getMenuIcon() }),
4352
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4353
+ "span",
4354
+ {
4355
+ "aria-hidden": "true",
4356
+ className: isMenuOpen ? "pts-close-icon" : "pts-open-icon",
4357
+ children: getMenuIcon()
4358
+ }
4359
+ ),
4326
4360
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pts-navigation-header-button-label", children: getMenuLabel() })
4327
4361
  ]
4328
4362
  }