@telia/teddy 0.0.47 → 0.0.49

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.
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const DrawerPrimitive = require("@radix-ui/react-dialog");
7
- const drawer_module = require("../../drawer.module-BymzBnov.cjs");
7
+ const drawer_module = require("../../drawer.module-CoqKvqzl.cjs");
8
8
  const components_drawer_drawerRoot = require("./drawer-root.cjs");
9
9
  require("../../assets/sprite.269ba410-teddy.svg");
10
10
  const components_icon_icon = require("../icon/icon.cjs");
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import * as DrawerPrimitive from "@radix-ui/react-dialog";
5
- import { s as styles } from "../../drawer.module-BC0junNQ.js";
5
+ import { s as styles } from "../../drawer.module-Am9xxZYU.js";
6
6
  import { rootClassName } from "./drawer-root.js";
7
7
  import "../../assets/sprite.269ba410-teddy.svg";
8
8
  import { Icon } from "../icon/icon.js";
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const DrawerPrimitive = require("@radix-ui/react-dialog");
7
- const drawer_module = require("../../drawer.module-BymzBnov.cjs");
7
+ const drawer_module = require("../../drawer.module-CoqKvqzl.cjs");
8
8
  const components_drawer_drawerRoot = require("./drawer-root.cjs");
9
9
  const components_drawer_drawerOverlay = require("./drawer-overlay.cjs");
10
10
  const components_flex_flex = require("../flex/flex.cjs");
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import * as DrawerPrimitive from "@radix-ui/react-dialog";
5
- import { s as styles } from "../../drawer.module-BC0junNQ.js";
5
+ import { s as styles } from "../../drawer.module-Am9xxZYU.js";
6
6
  import { rootClassName } from "./drawer-root.js";
7
7
  import { OverlayContext, Overlay } from "./drawer-overlay.js";
8
8
  import { Flex } from "../flex/flex.js";
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const DrawerPrimitive = require("@radix-ui/react-dialog");
7
- const drawer_module = require("../../drawer.module-BymzBnov.cjs");
7
+ const drawer_module = require("../../drawer.module-CoqKvqzl.cjs");
8
8
  const components_drawer_drawerRoot = require("./drawer-root.cjs");
9
9
  const components_text_text = require("../text/text.cjs");
10
10
  function _interopNamespaceDefault(e) {
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import * as DrawerPrimitive from "@radix-ui/react-dialog";
5
- import { s as styles } from "../../drawer.module-BC0junNQ.js";
5
+ import { s as styles } from "../../drawer.module-Am9xxZYU.js";
6
6
  import { rootClassName } from "./drawer-root.js";
7
7
  import { Text } from "../text/text.js";
8
8
  const DescriptionContext = React__default.createContext(false);
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
- const drawer_module = require("../../drawer.module-BymzBnov.cjs");
6
+ const drawer_module = require("../../drawer.module-CoqKvqzl.cjs");
7
7
  const components_drawer_drawerRoot = require("./drawer-root.cjs");
8
8
  const components_flex_flex = require("../flex/flex.cjs");
9
9
  const Footer = React.forwardRef(
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
- import { s as styles } from "../../drawer.module-BC0junNQ.js";
4
+ import { s as styles } from "../../drawer.module-Am9xxZYU.js";
5
5
  import { rootClassName } from "./drawer-root.js";
6
6
  import { Flex } from "../flex/flex.js";
7
7
  const Footer = React__default.forwardRef(
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const DrawerPrimitive = require("@radix-ui/react-dialog");
7
- const drawer_module = require("../../drawer.module-BymzBnov.cjs");
7
+ const drawer_module = require("../../drawer.module-CoqKvqzl.cjs");
8
8
  const components_drawer_drawerRoot = require("./drawer-root.cjs");
9
9
  function _interopNamespaceDefault(e) {
10
10
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import * as DrawerPrimitive from "@radix-ui/react-dialog";
5
- import { s as styles } from "../../drawer.module-BC0junNQ.js";
5
+ import { s as styles } from "../../drawer.module-Am9xxZYU.js";
6
6
  import { rootClassName } from "./drawer-root.js";
7
7
  const OverlayContext = React__default.createContext(false);
8
8
  const Overlay = React__default.forwardRef(
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const DrawerPrimitive = require("@radix-ui/react-dialog");
7
- const drawer_module = require("../../drawer.module-BymzBnov.cjs");
7
+ const drawer_module = require("../../drawer.module-CoqKvqzl.cjs");
8
8
  const components_drawer_drawerRoot = require("./drawer-root.cjs");
9
9
  const components_heading_heading = require("../heading/heading.cjs");
10
10
  function _interopNamespaceDefault(e) {
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import * as DrawerPrimitive from "@radix-ui/react-dialog";
5
- import { s as styles } from "../../drawer.module-BC0junNQ.js";
5
+ import { s as styles } from "../../drawer.module-Am9xxZYU.js";
6
6
  import { rootClassName } from "./drawer-root.js";
7
7
  import { Heading } from "../heading/heading.js";
8
8
  const Title = React__default.forwardRef(
@@ -29,17 +29,17 @@ 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_dagdv_1",
33
- "teddy-global-navigation__mobile-trigger": "_teddy-global-navigation__mobile-trigger_dagdv_6",
34
- "teddy-global-navigation__mobile-header": "_teddy-global-navigation__mobile-header_dagdv_9",
35
- "teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_dagdv_6",
36
- "teddy-global-navigation__link": "_teddy-global-navigation__link_dagdv_26",
37
- "teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_dagdv_29",
38
- "teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_dagdv_32",
39
- "teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_dagdv_35",
40
- "teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_dagdv_43",
41
- "close-viewport": "_close-viewport_dagdv_1",
42
- "teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_dagdv_54"
32
+ "teddy-global-navigation": "_teddy-global-navigation_i1ole_1",
33
+ "teddy-global-navigation__mobile-trigger": "_teddy-global-navigation__mobile-trigger_i1ole_6",
34
+ "teddy-global-navigation__mobile-header": "_teddy-global-navigation__mobile-header_i1ole_9",
35
+ "teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_i1ole_6",
36
+ "teddy-global-navigation__link": "_teddy-global-navigation__link_i1ole_26",
37
+ "teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_i1ole_29",
38
+ "teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_i1ole_32",
39
+ "teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_i1ole_36",
40
+ "teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_i1ole_43",
41
+ "close-viewport": "_close-viewport_i1ole_1",
42
+ "teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_i1ole_54"
43
43
  };
44
44
  function MyPages(props) {
45
45
  var _a, _b;
@@ -82,9 +82,10 @@ function LoggedOutContent() {
82
82
  ] });
83
83
  }
84
84
  function LoggedInContent() {
85
+ var _a;
85
86
  const rootContext = React.useContext(RootContext);
86
87
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
87
- /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { mb: "200", children: "Dine sider" }),
88
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: "Dine sider" }),
88
89
  /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs, { defaultValue: "private", children: [
89
90
  /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs.List, { children: [
90
91
  /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Trigger, { value: "private", children: "Privat" }),
@@ -93,7 +94,7 @@ function LoggedInContent() {
93
94
  /* @__PURE__ */ jsxRuntime.jsxs(components_textSpacing_textSpacing.TextSpacing, { children: [
94
95
  /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs.Content, { value: "private", children: [
95
96
  /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Privat" }),
96
- components_navigationMenu_globalNavigation_utils.MY_PAGE_LINKS.links.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "list-item", fullWidth: true, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.link, children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: link.icon, children: link.name }) }) }, link.link))
97
+ (_a = components_navigationMenu_globalNavigation_utils.MY_PAGE_LINKS.links) == null ? void 0 : _a.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "list-item", fullWidth: true, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.link, children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: link.icon, children: link.name }) }) }, link.link))
97
98
  ] }),
98
99
  /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs.Content, { value: "business", children: [
99
100
  /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Bedrift" }),
@@ -278,51 +279,67 @@ const Desktop = React.forwardRef(() => {
278
279
  children: /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.TopMenuList, { onFocus: resetAndShowMenu, ref: topMenuRef, children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.TopMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.TopMenuTrigger, { value: link.name, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: link.link, children: link.name }) }) }, link.name)) })
279
280
  }
280
281
  ),
281
- components_navigationMenu_globalNavigation_utils.LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsxs(components_navigationMenu_navigationMenu.NavigationMenu.List, { onFocus: resetAndShowMenu, value: link.name, children: [
282
- link.links.map((subLink) => /* @__PURE__ */ jsxRuntime.jsxs(components_navigationMenu_navigationMenu.NavigationMenu.Item, { value: subLink.name, children: [
283
- subLink.name === "Logo" ? /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
284
- "img",
285
- {
286
- src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
287
- draggable: "false",
288
- alt: "Telia logo"
289
- }
290
- ) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
291
- "img",
292
- {
293
- src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
294
- draggable: "false",
295
- alt: "Telia logo"
296
- }
297
- ) }) }) : /* @__PURE__ */ jsxRuntime.jsx(
298
- components_navigationMenu_navigationMenu.NavigationMenu.Trigger,
299
- {
300
- asChild: true,
301
- active: currentLocation === subLink.link,
302
- onClick: () => {
303
- rootContext.setPathname(subLink.link);
304
- },
305
- children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, children: subLink.name })
306
- }
307
- ),
308
- /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Content, { children: /* @__PURE__ */ jsxRuntime.jsx("ul", { children: subLink.links.map((subSubLink) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
309
- components_navigationMenu_navigationMenu.NavigationMenu.Link,
310
- {
311
- asChild: true,
312
- active: currentLocation.startsWith(subSubLink.link),
313
- onClick: () => {
314
- rootContext.setPathname(subSubLink.link);
315
- },
316
- variant: "small",
317
- children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subSubLink.link, children: subSubLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subSubLink.link, children: subSubLink.name })
318
- }
319
- ) }, subSubLink.name)) }) })
320
- ] }, subLink.name)),
321
- /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ml: "auto" }),
322
- /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(Search, {}) }),
323
- /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}) }),
324
- /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(MyPages, {}) })
325
- ] }, link.name)),
282
+ components_navigationMenu_globalNavigation_utils.LINKS.map((link) => {
283
+ var _a;
284
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_navigationMenu_navigationMenu.NavigationMenu.List, { onFocus: resetAndShowMenu, value: link.name, children: [
285
+ (_a = link.links) == null ? void 0 : _a.map((subLink) => {
286
+ var _a2, _b;
287
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_navigationMenu_navigationMenu.NavigationMenu.Item, { value: subLink.name, children: [
288
+ subLink.name === "Logo" ? /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
289
+ "img",
290
+ {
291
+ src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
292
+ draggable: "false",
293
+ alt: "Telia logo"
294
+ }
295
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
296
+ "img",
297
+ {
298
+ src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
299
+ draggable: "false",
300
+ alt: "Telia logo"
301
+ }
302
+ ) }) }) : ((_a2 = subLink.links) == null ? void 0 : _a2.length) ? /* @__PURE__ */ jsxRuntime.jsx(
303
+ components_navigationMenu_navigationMenu.NavigationMenu.Trigger,
304
+ {
305
+ asChild: true,
306
+ active: currentLocation === subLink.link,
307
+ onClick: () => {
308
+ rootContext.setPathname(subLink.link);
309
+ },
310
+ children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, children: subLink.name })
311
+ }
312
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
313
+ components_navigationMenu_navigationMenu.NavigationMenu.Link,
314
+ {
315
+ asChild: true,
316
+ active: currentLocation === subLink.link,
317
+ onClick: () => {
318
+ rootContext.setPathname(subLink.link);
319
+ },
320
+ children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, children: subLink.name })
321
+ }
322
+ ),
323
+ /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Content, { children: /* @__PURE__ */ jsxRuntime.jsx("ul", { children: (_b = subLink.links) == null ? void 0 : _b.map((subSubLink) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
324
+ components_navigationMenu_navigationMenu.NavigationMenu.Link,
325
+ {
326
+ asChild: true,
327
+ active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
328
+ onClick: () => {
329
+ rootContext.setPathname(subSubLink.link);
330
+ },
331
+ variant: "small",
332
+ children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subSubLink.link, children: subSubLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subSubLink.link, children: subSubLink.name })
333
+ }
334
+ ) }, subSubLink.name)) }) })
335
+ ] }, subLink.name);
336
+ }),
337
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ml: "auto" }),
338
+ /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}) }),
339
+ /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(Search, {}) }),
340
+ /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(MyPages, {}) })
341
+ ] }, link.name);
342
+ }),
326
343
  /* @__PURE__ */ jsxRuntime.jsx(
327
344
  "div",
328
345
  {
@@ -379,61 +396,67 @@ function Mobile(props) {
379
396
  /* @__PURE__ */ jsxRuntime.jsx(SearchField, {}),
380
397
  /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs, { value: rootContext.selectedDomainItem, onValueChange: rootContext.setSelectedDomainItem, children: [
381
398
  /* @__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)) }),
382
- /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mt: "400", children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Content, { value: link.name, children: /* @__PURE__ */ jsxRuntime.jsx(
383
- components_accordion_index.Accordion,
384
- {
385
- type: "single",
386
- collapsible: true,
387
- value: rootContext.selectedMenuItem,
388
- onValueChange: rootContext.setSelectedMenuItem,
389
- children: link.links.filter((l) => l.name !== "Logo").map((subLink) => /* @__PURE__ */ jsxRuntime.jsxs(components_accordion_index.Accordion.Item, { value: subLink.name, children: [
390
- /* @__PURE__ */ jsxRuntime.jsxs(components_accordion_index.Accordion.Header, { className: styles[`${rootClassName}__mobile-header`], children: [
391
- /* @__PURE__ */ jsxRuntime.jsx(
392
- components_link_link.Link,
393
- {
394
- className: linkClasses,
395
- href: "#",
396
- variant: "standalone",
397
- asChild: true,
398
- onClick: () => {
399
- var _a;
400
- (_a = drawerRef.current) == null ? void 0 : _a.click();
401
- rootContext.setSelectedMenuItem(subLink.name);
402
- rootContext.setPathname(subLink.link);
403
- },
404
- 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 })
405
- }
406
- ),
407
- /* @__PURE__ */ jsxRuntime.jsx(components_accordion_index.Accordion.Trigger, { className: styles[`${rootClassName}__mobile-trigger`], children: /* @__PURE__ */ jsxRuntime.jsxs(components_visuallyHidden_visuallyHidden.VisuallyHidden, { children: [
408
- subLink.name,
409
- " linker"
410
- ] }) })
411
- ] }),
412
- /* @__PURE__ */ jsxRuntime.jsx(components_accordion_index.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(components_list_index.List, { gap: "10", pl: "25", children: subLink.links.map((subSubLink) => /* @__PURE__ */ jsxRuntime.jsx(components_list_index.List.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(
413
- components_navigationMenu_navigationMenu.NavigationMenu.Link,
414
- {
415
- asChild: true,
416
- variant: "small",
417
- active: currentLocation.startsWith(subSubLink.link),
418
- onClick: () => {
419
- var _a;
420
- (_a = drawerRef.current) == null ? void 0 : _a.click();
421
- rootContext.setPathname(subSubLink.link);
422
- },
423
- 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: [
424
- subSubLink.name,
425
- " ",
426
- /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
427
- ] }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", children: [
428
- subSubLink.name,
429
- " ",
430
- /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
431
- ] }) })
432
- }
433
- ) }, subSubLink.name)) }) })
434
- ] }, subLink.name))
435
- }
436
- ) }, link.name)) })
399
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mt: "400", children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => {
400
+ var _a;
401
+ return /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Content, { value: link.name, children: /* @__PURE__ */ jsxRuntime.jsx(
402
+ components_accordion_index.Accordion,
403
+ {
404
+ type: "single",
405
+ collapsible: true,
406
+ value: rootContext.selectedMenuItem,
407
+ onValueChange: rootContext.setSelectedMenuItem,
408
+ children: (_a = link.links) == null ? void 0 : _a.filter((l) => l.name !== "Logo").map((subLink) => {
409
+ var _a2;
410
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_accordion_index.Accordion.Item, { value: subLink.name, children: [
411
+ /* @__PURE__ */ jsxRuntime.jsxs(components_accordion_index.Accordion.Header, { className: styles[`${rootClassName}__mobile-header`], children: [
412
+ /* @__PURE__ */ jsxRuntime.jsx(
413
+ components_link_link.Link,
414
+ {
415
+ className: linkClasses,
416
+ href: "#",
417
+ variant: "standalone",
418
+ asChild: true,
419
+ onClick: () => {
420
+ var _a3;
421
+ (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
422
+ rootContext.setSelectedMenuItem(subLink.name);
423
+ rootContext.setPathname(subLink.link);
424
+ },
425
+ 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 })
426
+ }
427
+ ),
428
+ /* @__PURE__ */ jsxRuntime.jsx(components_accordion_index.Accordion.Trigger, { className: styles[`${rootClassName}__mobile-trigger`], children: /* @__PURE__ */ jsxRuntime.jsxs(components_visuallyHidden_visuallyHidden.VisuallyHidden, { children: [
429
+ subLink.name,
430
+ " linker"
431
+ ] }) })
432
+ ] }),
433
+ /* @__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(
434
+ components_navigationMenu_navigationMenu.NavigationMenu.Link,
435
+ {
436
+ asChild: true,
437
+ variant: "small",
438
+ active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
439
+ onClick: () => {
440
+ var _a3;
441
+ (_a3 = drawerRef.current) == null ? void 0 : _a3.click();
442
+ rootContext.setPathname(subSubLink.link);
443
+ },
444
+ 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: [
445
+ subSubLink.name,
446
+ " ",
447
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
448
+ ] }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", children: [
449
+ subSubLink.name,
450
+ " ",
451
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
452
+ ] }) })
453
+ }
454
+ ) }, subSubLink.name)) }) })
455
+ ] }, subLink.name);
456
+ })
457
+ }
458
+ ) }, link.name);
459
+ }) })
437
460
  ] }),
438
461
  /* @__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, { children: "Lukk" }) }) })
439
462
  ] })
@@ -448,25 +471,28 @@ const DesktopSimplified = React.forwardRef(() => {
448
471
  return null;
449
472
  const { setSelectedMenuItem, linkComponent: Link } = rootContext;
450
473
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
451
- components_navigationMenu_globalNavigation_utils.LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsxs(components_navigationMenu_navigationMenu.NavigationMenu.List, { value: link.name, children: [
452
- link.links.map((subLink) => /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { value: subLink.name, children: subLink.name === "Logo" && /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
453
- "img",
454
- {
455
- src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
456
- draggable: "false",
457
- alt: "Telia logo"
458
- }
459
- ) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
460
- "img",
461
- {
462
- src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
463
- draggable: "false",
464
- alt: "Telia logo"
465
- }
466
- ) }) }) }, subLink.name)),
467
- /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ml: "auto" }),
468
- /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}) })
469
- ] }, link.name)),
474
+ components_navigationMenu_globalNavigation_utils.LINKS.map((link) => {
475
+ var _a;
476
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_navigationMenu_navigationMenu.NavigationMenu.List, { value: link.name, children: [
477
+ (_a = link.links) == null ? void 0 : _a.map((subLink) => /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { value: subLink.name, children: subLink.name === "Logo" && /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
478
+ "img",
479
+ {
480
+ src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
481
+ draggable: "false",
482
+ alt: "Telia logo"
483
+ }
484
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
485
+ "img",
486
+ {
487
+ src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
488
+ draggable: "false",
489
+ alt: "Telia logo"
490
+ }
491
+ ) }) }) }, subLink.name)),
492
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ml: "auto" }),
493
+ /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}) })
494
+ ] }, link.name);
495
+ }),
470
496
  /* @__PURE__ */ jsxRuntime.jsx(components_navigationMenu_navigationMenu.NavigationMenu.Viewport, { className: styles[`${rootClassName}__viewport`] })
471
497
  ] });
472
498
  });
@@ -562,25 +588,29 @@ function getInitialDomain(currentPath) {
562
588
  return initDomain;
563
589
  }
564
590
  function getInitialMenuItem(currentPath) {
565
- var _a, _b, _c;
591
+ var _a, _b, _c, _d, _e, _f;
566
592
  if (!currentPath)
567
593
  return;
568
594
  const locationArray = currentPath ? currentPath.split("/") : [];
569
595
  const initialDomain = getInitialDomain(currentPath);
570
596
  if (initialDomain === "Bedrift") {
571
597
  const mainMenuPartOfLocation2 = locationArray[2];
572
- return (_a = components_navigationMenu_globalNavigation_utils.BUSINESS_LINKS.links.find(
573
- (link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/` || link.links.some((link2) => link2.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`)
574
- )) == null ? void 0 : _a.name;
598
+ return (_b = (_a = components_navigationMenu_globalNavigation_utils.BUSINESS_LINKS.links) == null ? void 0 : _a.find(
599
+ (link) => {
600
+ var _a2;
601
+ return link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/` || ((_a2 = link.links) == null ? void 0 : _a2.some((link2) => link2.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`));
602
+ }
603
+ )) == null ? void 0 : _b.name;
575
604
  }
576
605
  if (initialDomain === "Borettslag") {
577
606
  const mainMenuPartOfLocation2 = locationArray[2];
578
- return (_b = components_navigationMenu_globalNavigation_utils.MDU_LINKS.links.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`)) == null ? void 0 : _b.name;
607
+ return (_d = (_c = components_navigationMenu_globalNavigation_utils.MDU_LINKS.links) == null ? void 0 : _c.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`)) == null ? void 0 : _d.name;
579
608
  }
580
609
  const mainMenuPartOfLocation = locationArray[1];
581
- return (_c = components_navigationMenu_globalNavigation_utils.PRIVATE_LINKS.links.find((link) => {
582
- return link.link === `/${mainMenuPartOfLocation}/` || link.links.some((link2) => link2.link === `/${mainMenuPartOfLocation}/`);
583
- })) == null ? void 0 : _c.name;
610
+ return (_f = (_e = components_navigationMenu_globalNavigation_utils.PRIVATE_LINKS.links) == null ? void 0 : _e.find((link) => {
611
+ var _a2;
612
+ return link.link === `/${mainMenuPartOfLocation}/` || ((_a2 = link.links) == null ? void 0 : _a2.some((link2) => link2.link === `/${mainMenuPartOfLocation}/`));
613
+ })) == null ? void 0 : _f.name;
584
614
  }
585
615
  Root.displayName = "GlobalNavigation";
586
616
  const GlobalNavigation = Root;