@telia/teddy 0.0.50 → 0.0.52

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.
@@ -29,19 +29,19 @@ const components_visuallyHidden_visuallyHidden = require("../../visually-hidden/
29
29
  const components_link_link = require("../../link/link.cjs");
30
30
  const components_list_index = require("../../list/index.cjs");
31
31
  const styles = {
32
- "teddy-global-navigation": "_teddy-global-navigation_1yaoy_1",
33
- "teddy-global-navigation__mobile-trigger": "_teddy-global-navigation__mobile-trigger_1yaoy_6",
34
- "teddy-global-navigation__mobile-header": "_teddy-global-navigation__mobile-header_1yaoy_9",
35
- "teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_1yaoy_6",
36
- "teddy-global-navigation__link": "_teddy-global-navigation__link_1yaoy_26",
37
- "teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_1yaoy_29",
38
- "teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_1yaoy_32",
39
- "teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_1yaoy_36",
40
- "teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_1yaoy_43",
41
- "close-viewport": "_close-viewport_1yaoy_1",
42
- "teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_1yaoy_54",
43
- "teddy-global-navigation__accordion-look": "_teddy-global-navigation__accordion-look_1yaoy_64",
44
- "teddy-global-navigation__mobile-link--accordion-look": "_teddy-global-navigation__mobile-link--accordion-look_1yaoy_80"
32
+ "teddy-global-navigation": "_teddy-global-navigation_1m6ra_1",
33
+ "teddy-global-navigation__mobile-trigger": "_teddy-global-navigation__mobile-trigger_1m6ra_6",
34
+ "teddy-global-navigation__mobile-header": "_teddy-global-navigation__mobile-header_1m6ra_9",
35
+ "teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_1m6ra_6",
36
+ "teddy-global-navigation__link": "_teddy-global-navigation__link_1m6ra_26",
37
+ "teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_1m6ra_29",
38
+ "teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_1m6ra_32",
39
+ "teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_1m6ra_36",
40
+ "teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_1m6ra_43",
41
+ "close-viewport": "_close-viewport_1m6ra_1",
42
+ "teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_1m6ra_54",
43
+ "teddy-global-navigation__accordion-look": "_teddy-global-navigation__accordion-look_1m6ra_64",
44
+ "teddy-global-navigation__mobile-link--accordion-look": "_teddy-global-navigation__mobile-link--accordion-look_1m6ra_80"
45
45
  };
46
46
  function MyPages(props) {
47
47
  var _a, _b;
@@ -287,7 +287,7 @@ const Desktop = React.forwardRef(() => {
287
287
  value: link.name,
288
288
  asChild: true,
289
289
  onClick: () => rootContext.setPathname(link.link),
290
- children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: link.link, children: link.name })
290
+ children: link.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: link.link, children: link.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.link, children: link.name })
291
291
  }
292
292
  ) }, link.name)) })
293
293
  }
@@ -407,26 +407,76 @@ function Mobile(props) {
407
407
  /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { ref: drawerRef, slot: "floating", "aria-label": "Lukk" }),
408
408
  /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: "Meny" }),
409
409
  /* @__PURE__ */ jsxRuntime.jsx(SearchField, {}),
410
- /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs, { value: rootContext.selectedDomainItem, onValueChange: rootContext.setSelectedDomainItem, children: [
411
- /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.List, { children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Trigger, { value: link.name, children: link.name }, link.name)) }),
412
- /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mt: "400", children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => {
413
- var _a;
414
- return /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Content, { value: link.name, children: /* @__PURE__ */ jsxRuntime.jsx(
415
- components_accordion_index.Accordion,
416
- {
417
- type: "single",
418
- collapsible: true,
419
- value: rootContext.selectedMenuItem,
420
- onValueChange: rootContext.setSelectedMenuItem,
421
- children: (_a = link.links) == null ? void 0 : _a.filter((l) => l.name !== "Logo").map(
422
- (subLink) => {
423
- var _a2;
424
- return subLink.links.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(components_accordion_index.Accordion.Item, { value: subLink.name, children: [
425
- /* @__PURE__ */ jsxRuntime.jsxs(components_accordion_index.Accordion.Header, { className: styles[`${rootClassName}__mobile-header`], children: [
426
- /* @__PURE__ */ jsxRuntime.jsx(
410
+ /* @__PURE__ */ jsxRuntime.jsxs(
411
+ components_tabs_index.Tabs,
412
+ {
413
+ value: rootContext.selectedDomainItem,
414
+ onValueChange: (v) => rootContext.setSelectedDomainItem(v, true),
415
+ children: [
416
+ /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.List, { children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Trigger, { value: link.name, children: link.name }, link.name)) }),
417
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mt: "400", children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => {
418
+ var _a;
419
+ return /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Content, { value: link.name, children: /* @__PURE__ */ jsxRuntime.jsx(
420
+ components_accordion_index.Accordion,
421
+ {
422
+ type: "single",
423
+ collapsible: true,
424
+ value: rootContext.selectedMenuItem,
425
+ onValueChange: (v) => rootContext.setSelectedMenuItem(v, true),
426
+ children: (_a = link.links) == null ? void 0 : _a.filter((l) => l.name !== "Logo").map(
427
+ (subLink) => {
428
+ var _a2;
429
+ return subLink.links.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(components_accordion_index.Accordion.Item, { value: subLink.name, children: [
430
+ /* @__PURE__ */ jsxRuntime.jsxs(components_accordion_index.Accordion.Header, { className: styles[`${rootClassName}__mobile-header`], children: [
431
+ /* @__PURE__ */ jsxRuntime.jsx(
432
+ components_link_link.Link,
433
+ {
434
+ className: linkClasses,
435
+ variant: "standalone",
436
+ asChild: true,
437
+ onClick: () => {
438
+ var _a3;
439
+ (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
440
+ rootContext.setSelectedMenuItem(subLink.name);
441
+ rootContext.setPathname(subLink.link);
442
+ },
443
+ children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(NavLink, { href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, children: subLink.name })
444
+ }
445
+ ),
446
+ /* @__PURE__ */ jsxRuntime.jsx(components_accordion_index.Accordion.Trigger, { className: styles[`${rootClassName}__mobile-trigger`], children: /* @__PURE__ */ jsxRuntime.jsxs(components_visuallyHidden_visuallyHidden.VisuallyHidden, { children: [
447
+ subLink.name,
448
+ " linker"
449
+ ] }) })
450
+ ] }),
451
+ /* @__PURE__ */ jsxRuntime.jsx(components_accordion_index.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(components_list_index.List, { gap: "10", pl: "25", children: (_a2 = subLink.links) == null ? void 0 : _a2.map((subSubLink) => /* @__PURE__ */ jsxRuntime.jsx(components_list_index.List.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(
452
+ components_navigationMenu_navigationMenu.NavigationMenu.Link,
453
+ {
454
+ asChild: true,
455
+ variant: "small",
456
+ active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
457
+ onClick: () => {
458
+ var _a3;
459
+ (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
460
+ rootContext.setPathname(subSubLink.link);
461
+ },
462
+ children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(NavLink, { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", children: [
463
+ subSubLink.name,
464
+ " ",
465
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
466
+ ] }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", children: [
467
+ subSubLink.name,
468
+ " ",
469
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
470
+ ] }) })
471
+ }
472
+ ) }, subSubLink.name)) }) })
473
+ ] }, subLink.name) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles[`${rootClassName}__accordion-look`], children: /* @__PURE__ */ jsxRuntime.jsx(
427
474
  components_link_link.Link,
428
475
  {
429
- className: linkClasses,
476
+ className: clsx([
477
+ linkClasses,
478
+ styles[`${rootClassName}__mobile-link--accordion-look`]
479
+ ]),
430
480
  variant: "standalone",
431
481
  asChild: true,
432
482
  onClick: () => {
@@ -435,67 +485,24 @@ function Mobile(props) {
435
485
  rootContext.setSelectedMenuItem(subLink.name);
436
486
  rootContext.setPathname(subLink.link);
437
487
  },
438
- children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(NavLink, { href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, children: subLink.name })
488
+ children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsxs(NavLink, { href: subLink.link, children: [
489
+ subLink.name,
490
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
491
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("a", { href: subLink.link, children: [
492
+ subLink.name,
493
+ " ",
494
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
495
+ ] })
439
496
  }
440
- ),
441
- /* @__PURE__ */ jsxRuntime.jsx(components_accordion_index.Accordion.Trigger, { className: styles[`${rootClassName}__mobile-trigger`], children: /* @__PURE__ */ jsxRuntime.jsxs(components_visuallyHidden_visuallyHidden.VisuallyHidden, { children: [
442
- subLink.name,
443
- " linker"
444
- ] }) })
445
- ] }),
446
- /* @__PURE__ */ jsxRuntime.jsx(components_accordion_index.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(components_list_index.List, { gap: "10", pl: "25", children: (_a2 = subLink.links) == null ? void 0 : _a2.map((subSubLink) => /* @__PURE__ */ jsxRuntime.jsx(components_list_index.List.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(
447
- components_navigationMenu_navigationMenu.NavigationMenu.Link,
448
- {
449
- asChild: true,
450
- variant: "small",
451
- active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
452
- onClick: () => {
453
- var _a3;
454
- (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
455
- rootContext.setPathname(subSubLink.link);
456
- },
457
- children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(NavLink, { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", children: [
458
- subSubLink.name,
459
- " ",
460
- /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
461
- ] }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", children: [
462
- subSubLink.name,
463
- " ",
464
- /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
465
- ] }) })
466
- }
467
- ) }, subSubLink.name)) }) })
468
- ] }, subLink.name) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles[`${rootClassName}__accordion-look`], children: /* @__PURE__ */ jsxRuntime.jsx(
469
- components_link_link.Link,
470
- {
471
- className: clsx([
472
- linkClasses,
473
- styles[`${rootClassName}__mobile-link--accordion-look`]
474
- ]),
475
- variant: "standalone",
476
- asChild: true,
477
- onClick: () => {
478
- var _a3;
479
- (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
480
- rootContext.setSelectedMenuItem(subLink.name);
481
- rootContext.setPathname(subLink.link);
482
- },
483
- children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsxs(NavLink, { href: subLink.link, children: [
484
- subLink.name,
485
- /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
486
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs("a", { href: subLink.link, children: [
487
- subLink.name,
488
- " ",
489
- /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
490
- ] })
497
+ ) }, subLink.name);
491
498
  }
492
- ) }, subLink.name);
499
+ )
493
500
  }
494
- )
495
- }
496
- ) }, link.name);
497
- }) })
498
- ] }),
501
+ ) }, link.name);
502
+ }) })
503
+ ]
504
+ }
505
+ ),
499
506
  /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "secondary", children: "Lukk" }) }) })
500
507
  ] })
501
508
  ] })
@@ -576,12 +583,24 @@ function Root({
576
583
  appKey,
577
584
  loggedInUser,
578
585
  selectedMenuItem,
579
- setSelectedMenuItem,
586
+ setSelectedMenuItem(v, onlyStateChange) {
587
+ if (appKey === "open-pages" && !onlyStateChange)
588
+ return;
589
+ setSelectedMenuItem(v);
590
+ },
580
591
  linkComponent,
581
592
  selectedDomainItem,
582
- setSelectedDomainItem,
593
+ setSelectedDomainItem(v, onlyStateChange) {
594
+ if (appKey === "open-pages" && !onlyStateChange)
595
+ return;
596
+ setSelectedDomainItem(v);
597
+ },
583
598
  pathname,
584
- setPathname,
599
+ setPathname(v) {
600
+ if (appKey === "open-pages")
601
+ return;
602
+ setPathname(v);
603
+ },
585
604
  onLogoutClick,
586
605
  shoppingCart,
587
606
  shoppingCartNumberOfItems,
@@ -597,7 +616,7 @@ function Root({
597
616
  onTopMenuValueChange: setSelectedDomainItem,
598
617
  value: selectedMenuItem,
599
618
  onValueChange: (v) => {
600
- if (v === "")
619
+ if (v === "" || appKey === "open-pages")
601
620
  return;
602
621
  setSelectedMenuItem(v);
603
622
  },
@@ -27,19 +27,19 @@ import { VisuallyHidden } from "../../visually-hidden/visually-hidden.js";
27
27
  import { Link } from "../../link/link.js";
28
28
  import { List } from "../../list/index.js";
29
29
  const styles = {
30
- "teddy-global-navigation": "_teddy-global-navigation_1yaoy_1",
31
- "teddy-global-navigation__mobile-trigger": "_teddy-global-navigation__mobile-trigger_1yaoy_6",
32
- "teddy-global-navigation__mobile-header": "_teddy-global-navigation__mobile-header_1yaoy_9",
33
- "teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_1yaoy_6",
34
- "teddy-global-navigation__link": "_teddy-global-navigation__link_1yaoy_26",
35
- "teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_1yaoy_29",
36
- "teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_1yaoy_32",
37
- "teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_1yaoy_36",
38
- "teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_1yaoy_43",
39
- "close-viewport": "_close-viewport_1yaoy_1",
40
- "teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_1yaoy_54",
41
- "teddy-global-navigation__accordion-look": "_teddy-global-navigation__accordion-look_1yaoy_64",
42
- "teddy-global-navigation__mobile-link--accordion-look": "_teddy-global-navigation__mobile-link--accordion-look_1yaoy_80"
30
+ "teddy-global-navigation": "_teddy-global-navigation_1m6ra_1",
31
+ "teddy-global-navigation__mobile-trigger": "_teddy-global-navigation__mobile-trigger_1m6ra_6",
32
+ "teddy-global-navigation__mobile-header": "_teddy-global-navigation__mobile-header_1m6ra_9",
33
+ "teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_1m6ra_6",
34
+ "teddy-global-navigation__link": "_teddy-global-navigation__link_1m6ra_26",
35
+ "teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_1m6ra_29",
36
+ "teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_1m6ra_32",
37
+ "teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_1m6ra_36",
38
+ "teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_1m6ra_43",
39
+ "close-viewport": "_close-viewport_1m6ra_1",
40
+ "teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_1m6ra_54",
41
+ "teddy-global-navigation__accordion-look": "_teddy-global-navigation__accordion-look_1m6ra_64",
42
+ "teddy-global-navigation__mobile-link--accordion-look": "_teddy-global-navigation__mobile-link--accordion-look_1m6ra_80"
43
43
  };
44
44
  function MyPages(props) {
45
45
  var _a, _b;
@@ -285,7 +285,7 @@ const Desktop = React__default.forwardRef(() => {
285
285
  value: link.name,
286
286
  asChild: true,
287
287
  onClick: () => rootContext.setPathname(link.link),
288
- children: /* @__PURE__ */ jsx(Link2, { href: link.link, children: link.name })
288
+ children: link.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { href: link.link, children: link.name }) : /* @__PURE__ */ jsx("a", { href: link.link, children: link.name })
289
289
  }
290
290
  ) }, link.name)) })
291
291
  }
@@ -405,26 +405,76 @@ function Mobile(props) {
405
405
  /* @__PURE__ */ jsx(Drawer.Close, { ref: drawerRef, slot: "floating", "aria-label": "Lukk" }),
406
406
  /* @__PURE__ */ jsx(Drawer.Title, { children: "Meny" }),
407
407
  /* @__PURE__ */ jsx(SearchField, {}),
408
- /* @__PURE__ */ jsxs(Tabs, { value: rootContext.selectedDomainItem, onValueChange: rootContext.setSelectedDomainItem, children: [
409
- /* @__PURE__ */ jsx(Tabs.List, { children: LINKS.map((link) => /* @__PURE__ */ jsx(Tabs.Trigger, { value: link.name, children: link.name }, link.name)) }),
410
- /* @__PURE__ */ jsx(Box, { mt: "400", children: LINKS.map((link) => {
411
- var _a;
412
- return /* @__PURE__ */ jsx(Tabs.Content, { value: link.name, children: /* @__PURE__ */ jsx(
413
- Accordion,
414
- {
415
- type: "single",
416
- collapsible: true,
417
- value: rootContext.selectedMenuItem,
418
- onValueChange: rootContext.setSelectedMenuItem,
419
- children: (_a = link.links) == null ? void 0 : _a.filter((l) => l.name !== "Logo").map(
420
- (subLink) => {
421
- var _a2;
422
- return subLink.links.length > 0 ? /* @__PURE__ */ jsxs(Accordion.Item, { value: subLink.name, children: [
423
- /* @__PURE__ */ jsxs(Accordion.Header, { className: styles[`${rootClassName}__mobile-header`], children: [
424
- /* @__PURE__ */ jsx(
408
+ /* @__PURE__ */ jsxs(
409
+ Tabs,
410
+ {
411
+ value: rootContext.selectedDomainItem,
412
+ onValueChange: (v) => rootContext.setSelectedDomainItem(v, true),
413
+ children: [
414
+ /* @__PURE__ */ jsx(Tabs.List, { children: LINKS.map((link) => /* @__PURE__ */ jsx(Tabs.Trigger, { value: link.name, children: link.name }, link.name)) }),
415
+ /* @__PURE__ */ jsx(Box, { mt: "400", children: LINKS.map((link) => {
416
+ var _a;
417
+ return /* @__PURE__ */ jsx(Tabs.Content, { value: link.name, children: /* @__PURE__ */ jsx(
418
+ Accordion,
419
+ {
420
+ type: "single",
421
+ collapsible: true,
422
+ value: rootContext.selectedMenuItem,
423
+ onValueChange: (v) => rootContext.setSelectedMenuItem(v, true),
424
+ children: (_a = link.links) == null ? void 0 : _a.filter((l) => l.name !== "Logo").map(
425
+ (subLink) => {
426
+ var _a2;
427
+ return subLink.links.length > 0 ? /* @__PURE__ */ jsxs(Accordion.Item, { value: subLink.name, children: [
428
+ /* @__PURE__ */ jsxs(Accordion.Header, { className: styles[`${rootClassName}__mobile-header`], children: [
429
+ /* @__PURE__ */ jsx(
430
+ Link,
431
+ {
432
+ className: linkClasses,
433
+ variant: "standalone",
434
+ asChild: true,
435
+ onClick: () => {
436
+ var _a3;
437
+ (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
438
+ rootContext.setSelectedMenuItem(subLink.name);
439
+ rootContext.setPathname(subLink.link);
440
+ },
441
+ children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(NavLink, { href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsx("a", { href: subLink.link, children: subLink.name })
442
+ }
443
+ ),
444
+ /* @__PURE__ */ jsx(Accordion.Trigger, { className: styles[`${rootClassName}__mobile-trigger`], children: /* @__PURE__ */ jsxs(VisuallyHidden, { children: [
445
+ subLink.name,
446
+ " linker"
447
+ ] }) })
448
+ ] }),
449
+ /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(List, { gap: "10", pl: "25", children: (_a2 = subLink.links) == null ? void 0 : _a2.map((subSubLink) => /* @__PURE__ */ jsx(List.Item, { children: /* @__PURE__ */ jsx(
450
+ NavigationMenu.Link,
451
+ {
452
+ asChild: true,
453
+ variant: "small",
454
+ active: getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
455
+ onClick: () => {
456
+ var _a3;
457
+ (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
458
+ rootContext.setPathname(subSubLink.link);
459
+ },
460
+ children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(NavLink, { href: subSubLink.link, children: /* @__PURE__ */ jsxs(Flex, { as: "span", gap: "100", children: [
461
+ subSubLink.name,
462
+ " ",
463
+ /* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
464
+ ] }) }) : /* @__PURE__ */ jsx("a", { href: subSubLink.link, children: /* @__PURE__ */ jsxs(Flex, { as: "span", gap: "100", children: [
465
+ subSubLink.name,
466
+ " ",
467
+ /* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
468
+ ] }) })
469
+ }
470
+ ) }, subSubLink.name)) }) })
471
+ ] }, subLink.name) : /* @__PURE__ */ jsx("div", { className: styles[`${rootClassName}__accordion-look`], children: /* @__PURE__ */ jsx(
425
472
  Link,
426
473
  {
427
- className: linkClasses,
474
+ className: clsx([
475
+ linkClasses,
476
+ styles[`${rootClassName}__mobile-link--accordion-look`]
477
+ ]),
428
478
  variant: "standalone",
429
479
  asChild: true,
430
480
  onClick: () => {
@@ -433,67 +483,24 @@ function Mobile(props) {
433
483
  rootContext.setSelectedMenuItem(subLink.name);
434
484
  rootContext.setPathname(subLink.link);
435
485
  },
436
- children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(NavLink, { href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsx("a", { href: subLink.link, children: subLink.name })
486
+ children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxs(NavLink, { href: subLink.link, children: [
487
+ subLink.name,
488
+ /* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
489
+ ] }) : /* @__PURE__ */ jsxs("a", { href: subLink.link, children: [
490
+ subLink.name,
491
+ " ",
492
+ /* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
493
+ ] })
437
494
  }
438
- ),
439
- /* @__PURE__ */ jsx(Accordion.Trigger, { className: styles[`${rootClassName}__mobile-trigger`], children: /* @__PURE__ */ jsxs(VisuallyHidden, { children: [
440
- subLink.name,
441
- " linker"
442
- ] }) })
443
- ] }),
444
- /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(List, { gap: "10", pl: "25", children: (_a2 = subLink.links) == null ? void 0 : _a2.map((subSubLink) => /* @__PURE__ */ jsx(List.Item, { children: /* @__PURE__ */ jsx(
445
- NavigationMenu.Link,
446
- {
447
- asChild: true,
448
- variant: "small",
449
- active: getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
450
- onClick: () => {
451
- var _a3;
452
- (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
453
- rootContext.setPathname(subSubLink.link);
454
- },
455
- children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(NavLink, { href: subSubLink.link, children: /* @__PURE__ */ jsxs(Flex, { as: "span", gap: "100", children: [
456
- subSubLink.name,
457
- " ",
458
- /* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
459
- ] }) }) : /* @__PURE__ */ jsx("a", { href: subSubLink.link, children: /* @__PURE__ */ jsxs(Flex, { as: "span", gap: "100", children: [
460
- subSubLink.name,
461
- " ",
462
- /* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
463
- ] }) })
464
- }
465
- ) }, subSubLink.name)) }) })
466
- ] }, subLink.name) : /* @__PURE__ */ jsx("div", { className: styles[`${rootClassName}__accordion-look`], children: /* @__PURE__ */ jsx(
467
- Link,
468
- {
469
- className: clsx([
470
- linkClasses,
471
- styles[`${rootClassName}__mobile-link--accordion-look`]
472
- ]),
473
- variant: "standalone",
474
- asChild: true,
475
- onClick: () => {
476
- var _a3;
477
- (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
478
- rootContext.setSelectedMenuItem(subLink.name);
479
- rootContext.setPathname(subLink.link);
480
- },
481
- children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxs(NavLink, { href: subLink.link, children: [
482
- subLink.name,
483
- /* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
484
- ] }) : /* @__PURE__ */ jsxs("a", { href: subLink.link, children: [
485
- subLink.name,
486
- " ",
487
- /* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
488
- ] })
495
+ ) }, subLink.name);
489
496
  }
490
- ) }, subLink.name);
497
+ )
491
498
  }
492
- )
493
- }
494
- ) }, link.name);
495
- }) })
496
- ] }),
499
+ ) }, link.name);
500
+ }) })
501
+ ]
502
+ }
503
+ ),
497
504
  /* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Lukk" }) }) })
498
505
  ] })
499
506
  ] })
@@ -574,12 +581,24 @@ function Root({
574
581
  appKey,
575
582
  loggedInUser,
576
583
  selectedMenuItem,
577
- setSelectedMenuItem,
584
+ setSelectedMenuItem(v, onlyStateChange) {
585
+ if (appKey === "open-pages" && !onlyStateChange)
586
+ return;
587
+ setSelectedMenuItem(v);
588
+ },
578
589
  linkComponent,
579
590
  selectedDomainItem,
580
- setSelectedDomainItem,
591
+ setSelectedDomainItem(v, onlyStateChange) {
592
+ if (appKey === "open-pages" && !onlyStateChange)
593
+ return;
594
+ setSelectedDomainItem(v);
595
+ },
581
596
  pathname,
582
- setPathname,
597
+ setPathname(v) {
598
+ if (appKey === "open-pages")
599
+ return;
600
+ setPathname(v);
601
+ },
583
602
  onLogoutClick,
584
603
  shoppingCart,
585
604
  shoppingCartNumberOfItems,
@@ -595,7 +614,7 @@ function Root({
595
614
  onTopMenuValueChange: setSelectedDomainItem,
596
615
  value: selectedMenuItem,
597
616
  onValueChange: (v) => {
598
- if (v === "")
617
+ if (v === "" || appKey === "open-pages")
599
618
  return;
600
619
  setSelectedMenuItem(v);
601
620
  },
@@ -21,9 +21,9 @@ export type RootProps = React.ComponentPropsWithoutRef<'div'> & {
21
21
  };
22
22
  type RootContext = {
23
23
  selectedMenuItem: string | undefined;
24
- setSelectedMenuItem: (v: string | undefined) => void;
24
+ setSelectedMenuItem: (v: string | undefined, onlyStateChange?: boolean) => void;
25
25
  selectedDomainItem: string;
26
- setSelectedDomainItem: (v: string) => void;
26
+ setSelectedDomainItem: (v: string, onlyStateChange?: boolean) => void;
27
27
  pathname: string;
28
28
  setPathname: (v: string) => void;
29
29
  } & Pick<RootProps, 'onSearchSubmit' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize'>;
@@ -34,7 +34,7 @@ const MY_PAGE_LINKS = {
34
34
  },
35
35
  {
36
36
  name: "Personvern",
37
- link: "/minside/innstillinger",
37
+ link: "/minside/personvern",
38
38
  appKey: APP_KEYS["my-pages"],
39
39
  icon: "secured-1"
40
40
  }
@@ -70,6 +70,7 @@ const LOGGED_IN_LINKS = [MY_PAGE_LINKS, ...LOGGED_IN_LINKS_BUSINESS];
70
70
  const PRIVATE_LINKS = {
71
71
  name: "Privat",
72
72
  link: "/",
73
+ appKey: APP_KEYS["open-pages"],
73
74
  links: [
74
75
  {
75
76
  name: "Logo",
@@ -255,6 +256,7 @@ const PRIVATE_LINKS = {
255
256
  const BUSINESS_LINKS = {
256
257
  name: "Bedrift",
257
258
  link: "/bedrift/",
259
+ appKey: APP_KEYS["open-pages"],
258
260
  links: [
259
261
  {
260
262
  name: "Logo",
@@ -313,6 +315,7 @@ const BUSINESS_LINKS = {
313
315
  const MDU_LINKS = {
314
316
  name: "Borettslag",
315
317
  link: "/borettslag/",
318
+ appKey: APP_KEYS["open-pages"],
316
319
  links: [
317
320
  {
318
321
  name: "Logo",
@@ -38,7 +38,7 @@ export declare const MY_PAGE_LINKS: {
38
38
  readonly icon: "doc";
39
39
  }, {
40
40
  readonly name: "Personvern";
41
- readonly link: "/minside/innstillinger";
41
+ readonly link: "/minside/personvern";
42
42
  readonly appKey: "my-pages";
43
43
  readonly icon: "secured-1";
44
44
  }];
@@ -104,7 +104,7 @@ export declare const LOGGED_IN_LINKS: [{
104
104
  readonly icon: "doc";
105
105
  }, {
106
106
  readonly name: "Personvern";
107
- readonly link: "/minside/innstillinger";
107
+ readonly link: "/minside/personvern";
108
108
  readonly appKey: "my-pages";
109
109
  readonly icon: "secured-1";
110
110
  }];
@@ -130,6 +130,7 @@ export declare const LOGGED_IN_LINKS: [{
130
130
  export declare const PRIVATE_LINKS: {
131
131
  readonly name: "Privat";
132
132
  readonly link: "/";
133
+ readonly appKey: "open-pages";
133
134
  readonly links: [{
134
135
  readonly name: "Logo";
135
136
  readonly link: "/";
@@ -256,6 +257,7 @@ export declare const PRIVATE_LINKS: {
256
257
  export declare const BUSINESS_LINKS: {
257
258
  readonly name: "Bedrift";
258
259
  readonly link: "/bedrift/";
260
+ readonly appKey: "open-pages";
259
261
  readonly links: [{
260
262
  readonly name: "Logo";
261
263
  readonly link: "/bedrift/";
@@ -303,6 +305,7 @@ export declare const BUSINESS_LINKS: {
303
305
  export declare const MDU_LINKS: {
304
306
  readonly name: "Borettslag";
305
307
  readonly link: "/borettslag/";
308
+ readonly appKey: "open-pages";
306
309
  readonly links: [{
307
310
  readonly name: "Logo";
308
311
  readonly link: "/borettslag/";
@@ -328,6 +331,7 @@ export declare const MDU_LINKS: {
328
331
  export declare const LINKS: [{
329
332
  readonly name: "Privat";
330
333
  readonly link: "/";
334
+ readonly appKey: "open-pages";
331
335
  readonly links: [{
332
336
  readonly name: "Logo";
333
337
  readonly link: "/";
@@ -453,6 +457,7 @@ export declare const LINKS: [{
453
457
  }, {
454
458
  readonly name: "Bedrift";
455
459
  readonly link: "/bedrift/";
460
+ readonly appKey: "open-pages";
456
461
  readonly links: [{
457
462
  readonly name: "Logo";
458
463
  readonly link: "/bedrift/";
@@ -499,6 +504,7 @@ export declare const LINKS: [{
499
504
  }, {
500
505
  readonly name: "Borettslag";
501
506
  readonly link: "/borettslag/";
507
+ readonly appKey: "open-pages";
502
508
  readonly links: [{
503
509
  readonly name: "Logo";
504
510
  readonly link: "/borettslag/";