@telia/teddy 0.0.49 → 0.0.50
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/navigation-menu/global-navigation/global-navigation-my-pages.cjs +87 -49
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.js +88 -50
- package/dist/components/navigation-menu/global-navigation/utils.cjs +1 -1
- package/dist/components/navigation-menu/global-navigation/utils.d.ts +2 -2
- package/dist/components/navigation-menu/global-navigation/utils.js +1 -1
- package/dist/components/navigation-menu/navigation-menu.cjs +20 -20
- package/dist/components/navigation-menu/navigation-menu.js +20 -20
- package/dist/style.css +494 -460
- package/package.json +1 -1
|
@@ -29,17 +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-
|
|
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_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"
|
|
43
45
|
};
|
|
44
46
|
function MyPages(props) {
|
|
45
47
|
var _a, _b;
|
|
@@ -56,7 +58,7 @@ function MyPages(props) {
|
|
|
56
58
|
/* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer.Content, { asChild: true, size: rootContext == null ? void 0 : rootContext.drawerSize, children: [
|
|
57
59
|
/* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "floating", "aria-label": "Lukk" }),
|
|
58
60
|
isLoggedIn ? /* @__PURE__ */ jsxRuntime.jsx(LoggedInContent, {}) : /* @__PURE__ */ jsxRuntime.jsx(LoggedOutContent, {}),
|
|
59
|
-
/* @__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" }) }) })
|
|
61
|
+
/* @__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" }) }) })
|
|
60
62
|
] })
|
|
61
63
|
] });
|
|
62
64
|
}
|
|
@@ -160,7 +162,7 @@ function Search(props) {
|
|
|
160
162
|
/* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "floating", "aria-label": "Lukk" }),
|
|
161
163
|
/* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: "Hva leter du etter?" }),
|
|
162
164
|
/* @__PURE__ */ jsxRuntime.jsx(SearchField, { ref: searchFieldRef }),
|
|
163
|
-
/* @__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" }) }) })
|
|
165
|
+
/* @__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" }) }) })
|
|
164
166
|
]
|
|
165
167
|
}
|
|
166
168
|
)
|
|
@@ -189,7 +191,7 @@ const ShoppingCart = React.forwardRef(() => {
|
|
|
189
191
|
titleSuffix
|
|
190
192
|
] }),
|
|
191
193
|
shoppingCartContent ? shoppingCartContent : null,
|
|
192
|
-
/* @__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" }) }) })
|
|
194
|
+
/* @__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" }) }) })
|
|
193
195
|
] })
|
|
194
196
|
] });
|
|
195
197
|
});
|
|
@@ -205,10 +207,13 @@ const Desktop = React.forwardRef(() => {
|
|
|
205
207
|
const lastScrollPos = React.useRef(0);
|
|
206
208
|
const topMenuRef = React.useRef(null);
|
|
207
209
|
const viewPortRef = React.useRef(null);
|
|
210
|
+
const shouldShowViewport = [...components_navigationMenu_globalNavigation_utils.PRIVATE_LINKS.links, ...components_navigationMenu_globalNavigation_utils.BUSINESS_LINKS.links, ...components_navigationMenu_globalNavigation_utils.MDU_LINKS.links].some(
|
|
211
|
+
(link) => link.links.some((subLink) => subLink.link === (rootContext == null ? void 0 : rootContext.pathname)) || link.links.length && link.link === (rootContext == null ? void 0 : rootContext.pathname)
|
|
212
|
+
);
|
|
208
213
|
const viewPortSize = utils_useSize.useSize(viewPortRef.current);
|
|
209
214
|
const topMenuSize = utils_useSize.useSize(topMenuRef.current);
|
|
210
215
|
const topMenuHeight = (topMenuSize == null ? void 0 : topMenuSize.height) ? `${topMenuSize.height}px` : void 0;
|
|
211
|
-
const viewPortHeight =
|
|
216
|
+
const viewPortHeight = shouldShowViewport ? "47px" : void 0;
|
|
212
217
|
const animationTimer = React.useRef(0);
|
|
213
218
|
const [allowAnimationOfHeight, setAllowAnimationOfHeight] = React.useState(false);
|
|
214
219
|
const timerRef = React.useRef(void 0);
|
|
@@ -276,7 +281,15 @@ const Desktop = React.forwardRef(() => {
|
|
|
276
281
|
),
|
|
277
282
|
className: styles[`${rootClassName}__top-menu-wrapper`],
|
|
278
283
|
"data-state": hideMenu ? "closed" : "open",
|
|
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(
|
|
284
|
+
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(
|
|
285
|
+
components_navigationMenu_navigationMenu.NavigationMenu.TopMenuTrigger,
|
|
286
|
+
{
|
|
287
|
+
value: link.name,
|
|
288
|
+
asChild: true,
|
|
289
|
+
onClick: () => rootContext.setPathname(link.link),
|
|
290
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: link.link, children: link.name })
|
|
291
|
+
}
|
|
292
|
+
) }, link.name)) })
|
|
280
293
|
}
|
|
281
294
|
),
|
|
282
295
|
components_navigationMenu_globalNavigation_utils.LINKS.map((link) => {
|
|
@@ -405,60 +418,85 @@ function Mobile(props) {
|
|
|
405
418
|
collapsible: true,
|
|
406
419
|
value: rootContext.selectedMenuItem,
|
|
407
420
|
onValueChange: rootContext.setSelectedMenuItem,
|
|
408
|
-
children: (_a = link.links) == null ? void 0 : _a.filter((l) => l.name !== "Logo").map(
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
/* @__PURE__ */ jsxRuntime.jsxs(components_accordion_index.Accordion.
|
|
412
|
-
/* @__PURE__ */ jsxRuntime.
|
|
413
|
-
|
|
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(
|
|
427
|
+
components_link_link.Link,
|
|
428
|
+
{
|
|
429
|
+
className: linkClasses,
|
|
430
|
+
variant: "standalone",
|
|
431
|
+
asChild: true,
|
|
432
|
+
onClick: () => {
|
|
433
|
+
var _a3;
|
|
434
|
+
(_a3 = drawerRef.current) == null ? void 0 : _a3.click();
|
|
435
|
+
rootContext.setSelectedMenuItem(subLink.name);
|
|
436
|
+
rootContext.setPathname(subLink.link);
|
|
437
|
+
},
|
|
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 })
|
|
439
|
+
}
|
|
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,
|
|
414
448
|
{
|
|
415
|
-
className: linkClasses,
|
|
416
|
-
href: "#",
|
|
417
|
-
variant: "standalone",
|
|
418
449
|
asChild: true,
|
|
450
|
+
variant: "small",
|
|
451
|
+
active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
|
|
419
452
|
onClick: () => {
|
|
420
453
|
var _a3;
|
|
421
454
|
(_a3 = drawerRef.current) == null ? void 0 : _a3.click();
|
|
422
|
-
rootContext.
|
|
423
|
-
rootContext.setPathname(subLink.link);
|
|
455
|
+
rootContext.setPathname(subSubLink.link);
|
|
424
456
|
},
|
|
425
|
-
children:
|
|
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
|
+
] }) })
|
|
426
466
|
}
|
|
427
|
-
),
|
|
428
|
-
|
|
429
|
-
|
|
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,
|
|
467
|
+
) }, subSubLink.name)) }) })
|
|
468
|
+
] }, subLink.name) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles[`${rootClassName}__accordion-look`], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
469
|
+
components_link_link.Link,
|
|
435
470
|
{
|
|
471
|
+
className: clsx([
|
|
472
|
+
linkClasses,
|
|
473
|
+
styles[`${rootClassName}__mobile-link--accordion-look`]
|
|
474
|
+
]),
|
|
475
|
+
variant: "standalone",
|
|
436
476
|
asChild: true,
|
|
437
|
-
variant: "small",
|
|
438
|
-
active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
|
|
439
477
|
onClick: () => {
|
|
440
478
|
var _a3;
|
|
441
479
|
(_a3 = drawerRef.current) == null ? void 0 : _a3.click();
|
|
442
|
-
rootContext.
|
|
480
|
+
rootContext.setSelectedMenuItem(subLink.name);
|
|
481
|
+
rootContext.setPathname(subLink.link);
|
|
443
482
|
},
|
|
444
|
-
children:
|
|
445
|
-
|
|
446
|
-
" ",
|
|
483
|
+
children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsxs(NavLink, { href: subLink.link, children: [
|
|
484
|
+
subLink.name,
|
|
447
485
|
/* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
|
|
448
|
-
] })
|
|
449
|
-
|
|
486
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("a", { href: subLink.link, children: [
|
|
487
|
+
subLink.name,
|
|
450
488
|
" ",
|
|
451
489
|
/* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
|
|
452
|
-
] })
|
|
490
|
+
] })
|
|
453
491
|
}
|
|
454
|
-
) },
|
|
455
|
-
|
|
456
|
-
|
|
492
|
+
) }, subLink.name);
|
|
493
|
+
}
|
|
494
|
+
)
|
|
457
495
|
}
|
|
458
496
|
) }, link.name);
|
|
459
497
|
}) })
|
|
460
498
|
] }),
|
|
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" }) }) })
|
|
499
|
+
/* @__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" }) }) })
|
|
462
500
|
] })
|
|
463
501
|
] })
|
|
464
502
|
] })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { MY_PAGE_LINKS, LOGGED_IN_LINKS_BUSINESS,
|
|
4
|
+
import { MY_PAGE_LINKS, LOGGED_IN_LINKS_BUSINESS, PRIVATE_LINKS, BUSINESS_LINKS, MDU_LINKS, LINKS, getActiveSubLink } from "./utils.js";
|
|
5
5
|
import { NavigationMenu } from "../navigation-menu.js";
|
|
6
6
|
import { Box } from "../../box/box.js";
|
|
7
7
|
import { Drawer } from "../../drawer/index.js";
|
|
@@ -27,17 +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-
|
|
31
|
-
"teddy-global-navigation__mobile-trigger": "_teddy-global-navigation__mobile-
|
|
32
|
-
"teddy-global-navigation__mobile-header": "_teddy-global-navigation__mobile-
|
|
33
|
-
"teddy-global-navigation__mobile": "_teddy-global-
|
|
34
|
-
"teddy-global-navigation__link": "_teddy-global-
|
|
35
|
-
"teddy-global-navigation__viewport": "_teddy-global-
|
|
36
|
-
"teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-
|
|
37
|
-
"teddy-global-navigation__item-count": "_teddy-global-navigation__item-
|
|
38
|
-
"teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-
|
|
39
|
-
"close-viewport": "_close-
|
|
40
|
-
"teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-
|
|
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"
|
|
41
43
|
};
|
|
42
44
|
function MyPages(props) {
|
|
43
45
|
var _a, _b;
|
|
@@ -54,7 +56,7 @@ function MyPages(props) {
|
|
|
54
56
|
/* @__PURE__ */ jsxs(Drawer.Content, { asChild: true, size: rootContext == null ? void 0 : rootContext.drawerSize, children: [
|
|
55
57
|
/* @__PURE__ */ jsx(Drawer.Close, { slot: "floating", "aria-label": "Lukk" }),
|
|
56
58
|
isLoggedIn ? /* @__PURE__ */ jsx(LoggedInContent, {}) : /* @__PURE__ */ jsx(LoggedOutContent, {}),
|
|
57
|
-
/* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { children: "Lukk" }) }) })
|
|
59
|
+
/* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Lukk" }) }) })
|
|
58
60
|
] })
|
|
59
61
|
] });
|
|
60
62
|
}
|
|
@@ -158,7 +160,7 @@ function Search(props) {
|
|
|
158
160
|
/* @__PURE__ */ jsx(Drawer.Close, { slot: "floating", "aria-label": "Lukk" }),
|
|
159
161
|
/* @__PURE__ */ jsx(Drawer.Title, { children: "Hva leter du etter?" }),
|
|
160
162
|
/* @__PURE__ */ jsx(SearchField, { ref: searchFieldRef }),
|
|
161
|
-
/* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { children: "Lukk" }) }) })
|
|
163
|
+
/* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Lukk" }) }) })
|
|
162
164
|
]
|
|
163
165
|
}
|
|
164
166
|
)
|
|
@@ -187,7 +189,7 @@ const ShoppingCart = React__default.forwardRef(() => {
|
|
|
187
189
|
titleSuffix
|
|
188
190
|
] }),
|
|
189
191
|
shoppingCartContent ? shoppingCartContent : null,
|
|
190
|
-
/* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { children: "Lukk" }) }) })
|
|
192
|
+
/* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Lukk" }) }) })
|
|
191
193
|
] })
|
|
192
194
|
] });
|
|
193
195
|
});
|
|
@@ -203,10 +205,13 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
203
205
|
const lastScrollPos = React__default.useRef(0);
|
|
204
206
|
const topMenuRef = React__default.useRef(null);
|
|
205
207
|
const viewPortRef = React__default.useRef(null);
|
|
208
|
+
const shouldShowViewport = [...PRIVATE_LINKS.links, ...BUSINESS_LINKS.links, ...MDU_LINKS.links].some(
|
|
209
|
+
(link) => link.links.some((subLink) => subLink.link === (rootContext == null ? void 0 : rootContext.pathname)) || link.links.length && link.link === (rootContext == null ? void 0 : rootContext.pathname)
|
|
210
|
+
);
|
|
206
211
|
const viewPortSize = useSize(viewPortRef.current);
|
|
207
212
|
const topMenuSize = useSize(topMenuRef.current);
|
|
208
213
|
const topMenuHeight = (topMenuSize == null ? void 0 : topMenuSize.height) ? `${topMenuSize.height}px` : void 0;
|
|
209
|
-
const viewPortHeight =
|
|
214
|
+
const viewPortHeight = shouldShowViewport ? "47px" : void 0;
|
|
210
215
|
const animationTimer = React__default.useRef(0);
|
|
211
216
|
const [allowAnimationOfHeight, setAllowAnimationOfHeight] = React__default.useState(false);
|
|
212
217
|
const timerRef = React__default.useRef(void 0);
|
|
@@ -274,7 +279,15 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
274
279
|
),
|
|
275
280
|
className: styles[`${rootClassName}__top-menu-wrapper`],
|
|
276
281
|
"data-state": hideMenu ? "closed" : "open",
|
|
277
|
-
children: /* @__PURE__ */ jsx(NavigationMenu.TopMenuList, { onFocus: resetAndShowMenu, ref: topMenuRef, children: LINKS.map((link) => /* @__PURE__ */ jsx(NavigationMenu.TopMenuItem, { children: /* @__PURE__ */ jsx(
|
|
282
|
+
children: /* @__PURE__ */ jsx(NavigationMenu.TopMenuList, { onFocus: resetAndShowMenu, ref: topMenuRef, children: LINKS.map((link) => /* @__PURE__ */ jsx(NavigationMenu.TopMenuItem, { children: /* @__PURE__ */ jsx(
|
|
283
|
+
NavigationMenu.TopMenuTrigger,
|
|
284
|
+
{
|
|
285
|
+
value: link.name,
|
|
286
|
+
asChild: true,
|
|
287
|
+
onClick: () => rootContext.setPathname(link.link),
|
|
288
|
+
children: /* @__PURE__ */ jsx(Link2, { href: link.link, children: link.name })
|
|
289
|
+
}
|
|
290
|
+
) }, link.name)) })
|
|
278
291
|
}
|
|
279
292
|
),
|
|
280
293
|
LINKS.map((link) => {
|
|
@@ -403,60 +416,85 @@ function Mobile(props) {
|
|
|
403
416
|
collapsible: true,
|
|
404
417
|
value: rootContext.selectedMenuItem,
|
|
405
418
|
onValueChange: rootContext.setSelectedMenuItem,
|
|
406
|
-
children: (_a = link.links) == null ? void 0 : _a.filter((l) => l.name !== "Logo").map(
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
/* @__PURE__ */ jsxs(Accordion.
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
|
|
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(
|
|
425
|
+
Link,
|
|
426
|
+
{
|
|
427
|
+
className: linkClasses,
|
|
428
|
+
variant: "standalone",
|
|
429
|
+
asChild: true,
|
|
430
|
+
onClick: () => {
|
|
431
|
+
var _a3;
|
|
432
|
+
(_a3 = drawerRef.current) == null ? void 0 : _a3.click();
|
|
433
|
+
rootContext.setSelectedMenuItem(subLink.name);
|
|
434
|
+
rootContext.setPathname(subLink.link);
|
|
435
|
+
},
|
|
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 })
|
|
437
|
+
}
|
|
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,
|
|
412
446
|
{
|
|
413
|
-
className: linkClasses,
|
|
414
|
-
href: "#",
|
|
415
|
-
variant: "standalone",
|
|
416
447
|
asChild: true,
|
|
448
|
+
variant: "small",
|
|
449
|
+
active: getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
|
|
417
450
|
onClick: () => {
|
|
418
451
|
var _a3;
|
|
419
452
|
(_a3 = drawerRef.current) == null ? void 0 : _a3.click();
|
|
420
|
-
rootContext.
|
|
421
|
-
rootContext.setPathname(subLink.link);
|
|
453
|
+
rootContext.setPathname(subSubLink.link);
|
|
422
454
|
},
|
|
423
|
-
children:
|
|
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
|
+
] }) })
|
|
424
464
|
}
|
|
425
|
-
),
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
" linker"
|
|
429
|
-
] }) })
|
|
430
|
-
] }),
|
|
431
|
-
/* @__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(
|
|
432
|
-
NavigationMenu.Link,
|
|
465
|
+
) }, subSubLink.name)) }) })
|
|
466
|
+
] }, subLink.name) : /* @__PURE__ */ jsx("div", { className: styles[`${rootClassName}__accordion-look`], children: /* @__PURE__ */ jsx(
|
|
467
|
+
Link,
|
|
433
468
|
{
|
|
469
|
+
className: clsx([
|
|
470
|
+
linkClasses,
|
|
471
|
+
styles[`${rootClassName}__mobile-link--accordion-look`]
|
|
472
|
+
]),
|
|
473
|
+
variant: "standalone",
|
|
434
474
|
asChild: true,
|
|
435
|
-
variant: "small",
|
|
436
|
-
active: getActiveSubLink(currentLocation, subLink.links || []) === subSubLink.link,
|
|
437
475
|
onClick: () => {
|
|
438
476
|
var _a3;
|
|
439
477
|
(_a3 = drawerRef.current) == null ? void 0 : _a3.click();
|
|
440
|
-
rootContext.
|
|
478
|
+
rootContext.setSelectedMenuItem(subLink.name);
|
|
479
|
+
rootContext.setPathname(subLink.link);
|
|
441
480
|
},
|
|
442
|
-
children:
|
|
443
|
-
|
|
444
|
-
" ",
|
|
481
|
+
children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxs(NavLink, { href: subLink.link, children: [
|
|
482
|
+
subLink.name,
|
|
445
483
|
/* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
|
|
446
|
-
] })
|
|
447
|
-
|
|
484
|
+
] }) : /* @__PURE__ */ jsxs("a", { href: subLink.link, children: [
|
|
485
|
+
subLink.name,
|
|
448
486
|
" ",
|
|
449
487
|
/* @__PURE__ */ jsx(Icon, { name: "arrow-right" })
|
|
450
|
-
] })
|
|
488
|
+
] })
|
|
451
489
|
}
|
|
452
|
-
) },
|
|
453
|
-
|
|
454
|
-
|
|
490
|
+
) }, subLink.name);
|
|
491
|
+
}
|
|
492
|
+
)
|
|
455
493
|
}
|
|
456
494
|
) }, link.name);
|
|
457
495
|
}) })
|
|
458
496
|
] }),
|
|
459
|
-
/* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { children: "Lukk" }) }) })
|
|
497
|
+
/* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Lukk" }) }) })
|
|
460
498
|
] })
|
|
461
499
|
] })
|
|
462
500
|
] })
|
|
@@ -195,7 +195,7 @@ export declare const PRIVATE_LINKS: {
|
|
|
195
195
|
readonly appKey: "open-pages";
|
|
196
196
|
readonly links: [{
|
|
197
197
|
readonly name: "Fast bredbånd";
|
|
198
|
-
readonly link: "/internett/
|
|
198
|
+
readonly link: "/internett/bredband/";
|
|
199
199
|
readonly appKey: "open-pages";
|
|
200
200
|
}, {
|
|
201
201
|
readonly name: "Trådløst bredbånd";
|
|
@@ -393,7 +393,7 @@ export declare const LINKS: [{
|
|
|
393
393
|
readonly appKey: "open-pages";
|
|
394
394
|
readonly links: [{
|
|
395
395
|
readonly name: "Fast bredbånd";
|
|
396
|
-
readonly link: "/internett/
|
|
396
|
+
readonly link: "/internett/bredband/";
|
|
397
397
|
readonly appKey: "open-pages";
|
|
398
398
|
}, {
|
|
399
399
|
readonly name: "Trådløst bredbånd";
|
|
@@ -28,27 +28,27 @@ function _interopNamespaceDefault(e) {
|
|
|
28
28
|
return Object.freeze(n);
|
|
29
29
|
}
|
|
30
30
|
const NavigationMenuPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(NavigationMenuPrimitive);
|
|
31
|
-
const scaleIn = "
|
|
32
|
-
const scaleOut = "
|
|
33
|
-
const enterFromRight = "
|
|
34
|
-
const enterFromLeft = "
|
|
35
|
-
const exitToRight = "
|
|
36
|
-
const exitToLeft = "
|
|
31
|
+
const scaleIn = "_scaleIn_1wcv5_1";
|
|
32
|
+
const scaleOut = "_scaleOut_1wcv5_1";
|
|
33
|
+
const enterFromRight = "_enterFromRight_1wcv5_1";
|
|
34
|
+
const enterFromLeft = "_enterFromLeft_1wcv5_1";
|
|
35
|
+
const exitToRight = "_exitToRight_1wcv5_1";
|
|
36
|
+
const exitToLeft = "_exitToLeft_1wcv5_1";
|
|
37
37
|
const styles = {
|
|
38
|
-
"teddy-navigation-menu": "_teddy-navigation-
|
|
39
|
-
"teddy-navigation-menu__viewport": "_teddy-navigation-
|
|
40
|
-
"teddy-navigation-menu__list": "_teddy-navigation-
|
|
41
|
-
"teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-
|
|
42
|
-
"teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-
|
|
43
|
-
"teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--
|
|
44
|
-
"teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--
|
|
45
|
-
"teddy-navigation-menu__content": "_teddy-navigation-
|
|
46
|
-
"teddy-navigation-menu__trigger": "_teddy-navigation-
|
|
47
|
-
"teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--
|
|
48
|
-
"teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--
|
|
49
|
-
"teddy-navigation-menu__link": "_teddy-navigation-
|
|
50
|
-
"teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--
|
|
51
|
-
"teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--
|
|
38
|
+
"teddy-navigation-menu": "_teddy-navigation-menu_1wcv5_2",
|
|
39
|
+
"teddy-navigation-menu__viewport": "_teddy-navigation-menu__viewport_1wcv5_35",
|
|
40
|
+
"teddy-navigation-menu__list": "_teddy-navigation-menu__list_1wcv5_38",
|
|
41
|
+
"teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-list_1wcv5_60",
|
|
42
|
+
"teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-trigger_1wcv5_84",
|
|
43
|
+
"teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--small_1wcv5_103",
|
|
44
|
+
"teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--button_1wcv5_109",
|
|
45
|
+
"teddy-navigation-menu__content": "_teddy-navigation-menu__content_1wcv5_183",
|
|
46
|
+
"teddy-navigation-menu__trigger": "_teddy-navigation-menu__trigger_1wcv5_219",
|
|
47
|
+
"teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--small_1wcv5_239",
|
|
48
|
+
"teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--button_1wcv5_245",
|
|
49
|
+
"teddy-navigation-menu__link": "_teddy-navigation-menu__link_1wcv5_312",
|
|
50
|
+
"teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--small_1wcv5_332",
|
|
51
|
+
"teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--button_1wcv5_338",
|
|
52
52
|
scaleIn,
|
|
53
53
|
scaleOut,
|
|
54
54
|
enterFromRight,
|
|
@@ -9,27 +9,27 @@ import { Slot } from "@radix-ui/react-slot";
|
|
|
9
9
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
10
10
|
import { mergeStyles } from "../../utils/generate-styling/index.js";
|
|
11
11
|
import { teddyMotionDuration300 } from "../../tokens/motion/variables.js";
|
|
12
|
-
const scaleIn = "
|
|
13
|
-
const scaleOut = "
|
|
14
|
-
const enterFromRight = "
|
|
15
|
-
const enterFromLeft = "
|
|
16
|
-
const exitToRight = "
|
|
17
|
-
const exitToLeft = "
|
|
12
|
+
const scaleIn = "_scaleIn_1wcv5_1";
|
|
13
|
+
const scaleOut = "_scaleOut_1wcv5_1";
|
|
14
|
+
const enterFromRight = "_enterFromRight_1wcv5_1";
|
|
15
|
+
const enterFromLeft = "_enterFromLeft_1wcv5_1";
|
|
16
|
+
const exitToRight = "_exitToRight_1wcv5_1";
|
|
17
|
+
const exitToLeft = "_exitToLeft_1wcv5_1";
|
|
18
18
|
const styles = {
|
|
19
|
-
"teddy-navigation-menu": "_teddy-navigation-
|
|
20
|
-
"teddy-navigation-menu__viewport": "_teddy-navigation-
|
|
21
|
-
"teddy-navigation-menu__list": "_teddy-navigation-
|
|
22
|
-
"teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-
|
|
23
|
-
"teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-
|
|
24
|
-
"teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--
|
|
25
|
-
"teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--
|
|
26
|
-
"teddy-navigation-menu__content": "_teddy-navigation-
|
|
27
|
-
"teddy-navigation-menu__trigger": "_teddy-navigation-
|
|
28
|
-
"teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--
|
|
29
|
-
"teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--
|
|
30
|
-
"teddy-navigation-menu__link": "_teddy-navigation-
|
|
31
|
-
"teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--
|
|
32
|
-
"teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--
|
|
19
|
+
"teddy-navigation-menu": "_teddy-navigation-menu_1wcv5_2",
|
|
20
|
+
"teddy-navigation-menu__viewport": "_teddy-navigation-menu__viewport_1wcv5_35",
|
|
21
|
+
"teddy-navigation-menu__list": "_teddy-navigation-menu__list_1wcv5_38",
|
|
22
|
+
"teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-list_1wcv5_60",
|
|
23
|
+
"teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-trigger_1wcv5_84",
|
|
24
|
+
"teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--small_1wcv5_103",
|
|
25
|
+
"teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--button_1wcv5_109",
|
|
26
|
+
"teddy-navigation-menu__content": "_teddy-navigation-menu__content_1wcv5_183",
|
|
27
|
+
"teddy-navigation-menu__trigger": "_teddy-navigation-menu__trigger_1wcv5_219",
|
|
28
|
+
"teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--small_1wcv5_239",
|
|
29
|
+
"teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--button_1wcv5_245",
|
|
30
|
+
"teddy-navigation-menu__link": "_teddy-navigation-menu__link_1wcv5_312",
|
|
31
|
+
"teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--small_1wcv5_332",
|
|
32
|
+
"teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--button_1wcv5_338",
|
|
33
33
|
scaleIn,
|
|
34
34
|
scaleOut,
|
|
35
35
|
enterFromRight,
|