@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.
- package/dist/components/drawer/drawer-close.cjs +1 -1
- package/dist/components/drawer/drawer-close.js +1 -1
- package/dist/components/drawer/drawer-content.cjs +1 -1
- package/dist/components/drawer/drawer-content.js +1 -1
- package/dist/components/drawer/drawer-description.cjs +1 -1
- package/dist/components/drawer/drawer-description.js +1 -1
- package/dist/components/drawer/drawer-footer.cjs +1 -1
- package/dist/components/drawer/drawer-footer.js +1 -1
- package/dist/components/drawer/drawer-overlay.cjs +1 -1
- package/dist/components/drawer/drawer-overlay.js +1 -1
- package/dist/components/drawer/drawer-title.cjs +1 -1
- package/dist/components/drawer/drawer-title.js +1 -1
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.cjs +170 -140
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.js +171 -141
- package/dist/components/navigation-menu/global-navigation/utils.cjs +17 -3
- package/dist/components/navigation-menu/global-navigation/utils.d.ts +64 -54
- package/dist/components/navigation-menu/global-navigation/utils.js +18 -4
- package/dist/components/navigation-menu/navigation-menu.cjs +24 -24
- package/dist/components/navigation-menu/navigation-menu.js +24 -24
- package/dist/drawer.module-Am9xxZYU.js +16 -0
- package/dist/drawer.module-CoqKvqzl.cjs +15 -0
- package/dist/style.css +120 -143
- package/package.json +1 -1
- package/dist/drawer.module-BC0junNQ.js +0 -16
- package/dist/drawer.module-BymzBnov.cjs +0 -15
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
33
|
-
"teddy-global-navigation__mobile-trigger": "_teddy-global-navigation__mobile-
|
|
34
|
-
"teddy-global-navigation__mobile-header": "_teddy-global-navigation__mobile-
|
|
35
|
-
"teddy-global-navigation__mobile": "_teddy-global-
|
|
36
|
-
"teddy-global-navigation__link": "_teddy-global-
|
|
37
|
-
"teddy-global-navigation__viewport": "_teddy-global-
|
|
38
|
-
"teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-
|
|
39
|
-
"teddy-global-navigation__item-count": "_teddy-global-navigation__item-
|
|
40
|
-
"teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-
|
|
41
|
-
"close-viewport": "_close-
|
|
42
|
-
"teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-
|
|
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, {
|
|
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) =>
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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) =>
|
|
383
|
-
|
|
384
|
-
{
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
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) =>
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
{
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
{
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
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) =>
|
|
574
|
-
|
|
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 (
|
|
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 (
|
|
582
|
-
|
|
583
|
-
|
|
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;
|