@telia/teddy 0.1.23 → 0.1.25

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.
@@ -7,8 +7,6 @@ require("./utils.cjs");
7
7
  require("../../box/box.cjs");
8
8
  require("../../../utils/useSize.cjs");
9
9
  require("../../../utils/generate-styling/index.cjs");
10
- require("../../../utils/useCallbackRef.cjs");
11
- require("../../../tokens/motion/variables.cjs");
12
10
  require("../../../assets/sprite.269ba410-teddy.svg");
13
11
  require("../../icon/icon.cjs");
14
12
  require("../../flex/flex.cjs");
@@ -5,8 +5,6 @@ import "./utils.js";
5
5
  import "../../box/box.js";
6
6
  import "../../../utils/useSize.js";
7
7
  import "../../../utils/generate-styling/index.js";
8
- import "../../../utils/useCallbackRef.js";
9
- import "../../../tokens/motion/variables.js";
10
8
  import "../../../assets/sprite.269ba410-teddy.svg";
11
9
  import "../../icon/icon.js";
12
10
  import "../../flex/flex.js";
@@ -13,6 +13,7 @@ export type RootProps = React.ComponentPropsWithoutRef<'div'> & {
13
13
  shoppingCart?: React.ReactNode;
14
14
  shoppingCartNumberOfItems?: number;
15
15
  onSearchSubmit?: (e: React.FormEvent<HTMLFormElement>, value?: string) => void;
16
+ additionalSearchContent?: React.ReactNode;
16
17
  isCartOpen?: boolean;
17
18
  onCartOpenChange?: (open: boolean) => void;
18
19
  drawerSize: 'md' | 'lg';
@@ -29,9 +30,9 @@ type RootContext = {
29
30
  specifiedLink?: string;
30
31
  setSpecifiedLink: (v: string) => void;
31
32
  hideMenu?: boolean | null;
32
- } & Pick<RootProps, 'onSearchSubmit' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize'>;
33
+ } & Pick<RootProps, 'onSearchSubmit' | 'additionalSearchContent' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize'>;
33
34
  export declare const RootContext: React.Context<RootContext | null>;
34
- export declare function Root({ className, appKey, loggedInUser, linkComponent, onLogoutClick, shoppingCart, shoppingCartNumberOfItems, onSearchSubmit, isCartOpen, onCartOpenChange, drawerSize, isSimplified, currentPath, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
35
+ export declare function Root({ className, appKey, loggedInUser, linkComponent, onLogoutClick, shoppingCart, shoppingCartNumberOfItems, onSearchSubmit, additionalSearchContent, isCartOpen, onCartOpenChange, drawerSize, isSimplified, currentPath, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
35
36
  export declare namespace Root {
36
37
  var displayName: string;
37
38
  }
@@ -117,7 +117,7 @@ const PRIVATE_LINKS = {
117
117
  appKey: APP_KEYS["open-pages"],
118
118
  highlightedLinks: [
119
119
  {
120
- name: "Telia X",
120
+ name: "Kjøp Telia X",
121
121
  link: "/mobil/mobilabonnement/ubegrenset-data/",
122
122
  appKey: APP_KEYS["web-shop"]
123
123
  },
@@ -127,12 +127,12 @@ const PRIVATE_LINKS = {
127
127
  appKey: APP_KEYS["web-shop"]
128
128
  },
129
129
  {
130
- name: "iPhone",
130
+ name: "Kjøp iPhone",
131
131
  link: "/varemerker/apple/iphone/",
132
132
  appKey: APP_KEYS["web-shop"]
133
133
  },
134
134
  {
135
- name: "Airpods",
135
+ name: "Kjøp AirPods",
136
136
  link: "/varemerker/apple/airpods/",
137
137
  appKey: APP_KEYS["web-shop"]
138
138
  },
@@ -183,11 +183,6 @@ const PRIVATE_LINKS = {
183
183
  link: "/mobil/tilbehor/",
184
184
  appKey: APP_KEYS["web-shop"]
185
185
  },
186
- // {
187
- // name: 'Pakketilbud',
188
- // link: '/mobil/mobilabonnement/pakketilbud/',
189
- // appKey: APP_KEYS['web-shop'],
190
- // },
191
186
  {
192
187
  name: "Påfyll kontantkort",
193
188
  link: "/mobil/mobilabonnement/kontantkort/lade/",
@@ -221,7 +216,7 @@ const PRIVATE_LINKS = {
221
216
  appKey: APP_KEYS["open-pages"]
222
217
  },
223
218
  {
224
- name: "Premier League",
219
+ name: "Kjøp Premier League",
225
220
  link: "/tv/innholdsoversikt/premiumtjenester/premier-league-v-premium/",
226
221
  appKey: APP_KEYS["open-pages"]
227
222
  },
@@ -250,7 +245,6 @@ const PRIVATE_LINKS = {
250
245
  {
251
246
  name: "Se Telia Play",
252
247
  link: "https://www.teliaplay.no",
253
- // icon: 'external',
254
248
  appKey: APP_KEYS["open-pages"]
255
249
  },
256
250
  {
@@ -263,21 +257,11 @@ const PRIVATE_LINKS = {
263
257
  link: "/tv/innholdsoversikt/strommetjenester/",
264
258
  appKey: APP_KEYS["open-pages"]
265
259
  },
266
- // {
267
- // name: 'TV-kanaler',
268
- // link: '/tv/tv-kanaler-og-kanalpakker/',
269
- // appKey: APP_KEYS['open-pages'],
270
- // },
271
260
  {
272
261
  name: "Premiumtjenester",
273
262
  link: "/tv/innholdsoversikt/premiumtjenester/",
274
263
  appKey: APP_KEYS["open-pages"]
275
264
  },
276
- // {
277
- // name: 'Filmer',
278
- // link: '/tv/filmleie-og-filmkjop/',
279
- // appKey: APP_KEYS['open-pages'],
280
- // },
281
265
  {
282
266
  name: "TV-bokser",
283
267
  link: "/tv/tv-bokser/",
@@ -306,7 +290,7 @@ const PRIVATE_LINKS = {
306
290
  appKey: APP_KEYS["open-pages"]
307
291
  },
308
292
  {
309
- name: "Bredbånd hytta",
293
+ name: "Kjøp bredbånd til hytta",
310
294
  link: "/internett/tradlost-bredband-hytte/",
311
295
  appKey: APP_KEYS["open-pages"]
312
296
  },
@@ -168,7 +168,7 @@ export declare const PRIVATE_LINKS: {
168
168
  readonly link: "";
169
169
  readonly appKey: "open-pages";
170
170
  readonly highlightedLinks: [{
171
- readonly name: "Telia X";
171
+ readonly name: "Kjøp Telia X";
172
172
  readonly link: "/mobil/mobilabonnement/ubegrenset-data/";
173
173
  readonly appKey: "web-shop";
174
174
  }, {
@@ -176,11 +176,11 @@ export declare const PRIVATE_LINKS: {
176
176
  readonly link: "/mobil/mobilabonnement/pakketilbud/";
177
177
  readonly appKey: "web-shop";
178
178
  }, {
179
- readonly name: "iPhone";
179
+ readonly name: "Kjøp iPhone";
180
180
  readonly link: "/varemerker/apple/iphone/";
181
181
  readonly appKey: "web-shop";
182
182
  }, {
183
- readonly name: "Airpods";
183
+ readonly name: "Kjøp AirPods";
184
184
  readonly link: "/varemerker/apple/airpods/";
185
185
  readonly appKey: "web-shop";
186
186
  }, {
@@ -246,7 +246,7 @@ export declare const PRIVATE_LINKS: {
246
246
  readonly link: "/tv/innholdsoversikt/strommetjenester/#registrere";
247
247
  readonly appKey: "open-pages";
248
248
  }, {
249
- readonly name: "Premier League";
249
+ readonly name: "Kjøp Premier League";
250
250
  readonly link: "/tv/innholdsoversikt/premiumtjenester/premier-league-v-premium/";
251
251
  readonly appKey: "open-pages";
252
252
  }, {
@@ -304,7 +304,7 @@ export declare const PRIVATE_LINKS: {
304
304
  readonly link: "/internett/sok-adresse/";
305
305
  readonly appKey: "open-pages";
306
306
  }, {
307
- readonly name: "Bredbånd hytta";
307
+ readonly name: "Kjøp bredbånd til hytta";
308
308
  readonly link: "/internett/tradlost-bredband-hytte/";
309
309
  readonly appKey: "open-pages";
310
310
  }, {
@@ -613,7 +613,7 @@ export declare const LINKS: [{
613
613
  readonly link: "";
614
614
  readonly appKey: "open-pages";
615
615
  readonly highlightedLinks: [{
616
- readonly name: "Telia X";
616
+ readonly name: "Kjøp Telia X";
617
617
  readonly link: "/mobil/mobilabonnement/ubegrenset-data/";
618
618
  readonly appKey: "web-shop";
619
619
  }, {
@@ -621,11 +621,11 @@ export declare const LINKS: [{
621
621
  readonly link: "/mobil/mobilabonnement/pakketilbud/";
622
622
  readonly appKey: "web-shop";
623
623
  }, {
624
- readonly name: "iPhone";
624
+ readonly name: "Kjøp iPhone";
625
625
  readonly link: "/varemerker/apple/iphone/";
626
626
  readonly appKey: "web-shop";
627
627
  }, {
628
- readonly name: "Airpods";
628
+ readonly name: "Kjøp AirPods";
629
629
  readonly link: "/varemerker/apple/airpods/";
630
630
  readonly appKey: "web-shop";
631
631
  }, {
@@ -691,7 +691,7 @@ export declare const LINKS: [{
691
691
  readonly link: "/tv/innholdsoversikt/strommetjenester/#registrere";
692
692
  readonly appKey: "open-pages";
693
693
  }, {
694
- readonly name: "Premier League";
694
+ readonly name: "Kjøp Premier League";
695
695
  readonly link: "/tv/innholdsoversikt/premiumtjenester/premier-league-v-premium/";
696
696
  readonly appKey: "open-pages";
697
697
  }, {
@@ -749,7 +749,7 @@ export declare const LINKS: [{
749
749
  readonly link: "/internett/sok-adresse/";
750
750
  readonly appKey: "open-pages";
751
751
  }, {
752
- readonly name: "Bredbånd hytta";
752
+ readonly name: "Kjøp bredbånd til hytta";
753
753
  readonly link: "/internett/tradlost-bredband-hytte/";
754
754
  readonly appKey: "open-pages";
755
755
  }, {
@@ -115,7 +115,7 @@ const PRIVATE_LINKS = {
115
115
  appKey: APP_KEYS["open-pages"],
116
116
  highlightedLinks: [
117
117
  {
118
- name: "Telia X",
118
+ name: "Kjøp Telia X",
119
119
  link: "/mobil/mobilabonnement/ubegrenset-data/",
120
120
  appKey: APP_KEYS["web-shop"]
121
121
  },
@@ -125,12 +125,12 @@ const PRIVATE_LINKS = {
125
125
  appKey: APP_KEYS["web-shop"]
126
126
  },
127
127
  {
128
- name: "iPhone",
128
+ name: "Kjøp iPhone",
129
129
  link: "/varemerker/apple/iphone/",
130
130
  appKey: APP_KEYS["web-shop"]
131
131
  },
132
132
  {
133
- name: "Airpods",
133
+ name: "Kjøp AirPods",
134
134
  link: "/varemerker/apple/airpods/",
135
135
  appKey: APP_KEYS["web-shop"]
136
136
  },
@@ -181,11 +181,6 @@ const PRIVATE_LINKS = {
181
181
  link: "/mobil/tilbehor/",
182
182
  appKey: APP_KEYS["web-shop"]
183
183
  },
184
- // {
185
- // name: 'Pakketilbud',
186
- // link: '/mobil/mobilabonnement/pakketilbud/',
187
- // appKey: APP_KEYS['web-shop'],
188
- // },
189
184
  {
190
185
  name: "Påfyll kontantkort",
191
186
  link: "/mobil/mobilabonnement/kontantkort/lade/",
@@ -219,7 +214,7 @@ const PRIVATE_LINKS = {
219
214
  appKey: APP_KEYS["open-pages"]
220
215
  },
221
216
  {
222
- name: "Premier League",
217
+ name: "Kjøp Premier League",
223
218
  link: "/tv/innholdsoversikt/premiumtjenester/premier-league-v-premium/",
224
219
  appKey: APP_KEYS["open-pages"]
225
220
  },
@@ -248,7 +243,6 @@ const PRIVATE_LINKS = {
248
243
  {
249
244
  name: "Se Telia Play",
250
245
  link: "https://www.teliaplay.no",
251
- // icon: 'external',
252
246
  appKey: APP_KEYS["open-pages"]
253
247
  },
254
248
  {
@@ -261,21 +255,11 @@ const PRIVATE_LINKS = {
261
255
  link: "/tv/innholdsoversikt/strommetjenester/",
262
256
  appKey: APP_KEYS["open-pages"]
263
257
  },
264
- // {
265
- // name: 'TV-kanaler',
266
- // link: '/tv/tv-kanaler-og-kanalpakker/',
267
- // appKey: APP_KEYS['open-pages'],
268
- // },
269
258
  {
270
259
  name: "Premiumtjenester",
271
260
  link: "/tv/innholdsoversikt/premiumtjenester/",
272
261
  appKey: APP_KEYS["open-pages"]
273
262
  },
274
- // {
275
- // name: 'Filmer',
276
- // link: '/tv/filmleie-og-filmkjop/',
277
- // appKey: APP_KEYS['open-pages'],
278
- // },
279
263
  {
280
264
  name: "TV-bokser",
281
265
  link: "/tv/tv-bokser/",
@@ -304,7 +288,7 @@ const PRIVATE_LINKS = {
304
288
  appKey: APP_KEYS["open-pages"]
305
289
  },
306
290
  {
307
- name: "Bredbånd hytta",
291
+ name: "Kjøp bredbånd til hytta",
308
292
  link: "/internett/tradlost-bredband-hytte/",
309
293
  appKey: APP_KEYS["open-pages"]
310
294
  },
@@ -65,7 +65,6 @@ const components_radioCardGroup_radioCardGroupIndicator = require("./radio-card-
65
65
  const components_radioCardGroup_radioCardGroupItemBody = require("./radio-card-group-item-body.cjs");
66
66
  const RadioGroupPrimitive = require("@radix-ui/react-radio-group");
67
67
  const utils_useSize = require("../../utils/useSize.cjs");
68
- const utils_useCallbackRef = require("../../utils/useCallbackRef.cjs");
69
68
  function _interopNamespaceDefault(e) {
70
69
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
71
70
  if (e) {
@@ -282,34 +281,22 @@ const Close = React.forwardRef(
282
281
  );
283
282
  Close.displayName = "Dialog.Close";
284
283
  const Modal = Object.assign(Root$2, { Trigger: Trigger$1, Content: Content$1, Title, Overlay, Description, Close, Image, Group });
285
- const scaleIn = "_scaleIn_gpawj_1";
286
- const scaleOut = "_scaleOut_gpawj_1";
287
- const enterFromRight = "_enterFromRight_gpawj_1";
288
- const enterFromLeft = "_enterFromLeft_gpawj_1";
289
- const exitToRight = "_exitToRight_gpawj_1";
290
- const exitToLeft = "_exitToLeft_gpawj_1";
291
284
  const styles$1 = {
292
- "teddy-navigation-menu": "_teddy-navigation-menu_gpawj_1",
293
- "teddy-navigation-menu__viewport": "_teddy-navigation-menu__viewport_gpawj_34",
294
- "teddy-navigation-menu__separator": "_teddy-navigation-menu__separator_gpawj_37",
295
- "teddy-navigation-menu__list": "_teddy-navigation-menu__list_gpawj_40",
296
- "teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-list_gpawj_66",
297
- "teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-trigger_gpawj_87",
298
- "teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--small_gpawj_106",
299
- "teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--button_gpawj_112",
300
- "teddy-navigation-menu__content": "_teddy-navigation-menu__content_gpawj_187",
301
- "teddy-navigation-menu__trigger": "_teddy-navigation-menu__trigger_gpawj_228",
302
- "teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--small_gpawj_248",
303
- "teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--button_gpawj_254",
304
- "teddy-navigation-menu__link": "_teddy-navigation-menu__link_gpawj_322",
305
- "teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--small_gpawj_342",
306
- "teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--button_gpawj_348",
307
- scaleIn,
308
- scaleOut,
309
- enterFromRight,
310
- enterFromLeft,
311
- exitToRight,
312
- exitToLeft
285
+ "teddy-navigation-menu": "_teddy-navigation-menu_6p30v_1",
286
+ "teddy-navigation-menu__viewport": "_teddy-navigation-menu__viewport_6p30v_34",
287
+ "teddy-navigation-menu__separator": "_teddy-navigation-menu__separator_6p30v_37",
288
+ "teddy-navigation-menu__list": "_teddy-navigation-menu__list_6p30v_40",
289
+ "teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-list_6p30v_66",
290
+ "teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-trigger_6p30v_87",
291
+ "teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--small_6p30v_106",
292
+ "teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--button_6p30v_112",
293
+ "teddy-navigation-menu__content": "_teddy-navigation-menu__content_6p30v_187",
294
+ "teddy-navigation-menu__trigger": "_teddy-navigation-menu__trigger_6p30v_219",
295
+ "teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--small_6p30v_239",
296
+ "teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--button_6p30v_245",
297
+ "teddy-navigation-menu__link": "_teddy-navigation-menu__link_6p30v_313",
298
+ "teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--small_6p30v_333",
299
+ "teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--button_6p30v_339"
313
300
  };
314
301
  const rootClassName$1 = "teddy-navigation-menu";
315
302
  const NavigationMenuContext = React.createContext({
@@ -555,9 +542,6 @@ const Trigger = React.forwardRef(
555
542
  return /* @__PURE__ */ jsxRuntime.jsx(
556
543
  NavigationMenuPrimitive__namespace.Trigger,
557
544
  {
558
- onPointerEnter: (e) => e.preventDefault(),
559
- onPointerMove: (e) => e.preventDefault(),
560
- onPointerLeave: (e) => e.preventDefault(),
561
545
  ...props,
562
546
  ref,
563
547
  "data-active": active ? "true" : void 0,
@@ -578,8 +562,6 @@ const Content = React.forwardRef(
578
562
  return /* @__PURE__ */ jsxRuntime.jsx(
579
563
  NavigationMenuPrimitive__namespace.Content,
580
564
  {
581
- onPointerEnter: (e) => e.preventDefault(),
582
- onPointerLeave: (e) => e.preventDefault(),
583
565
  ...props,
584
566
  ref: forwardRef,
585
567
  className: classes
@@ -699,27 +681,22 @@ const NavigationMenu = Object.assign(Root$1, {
699
681
  TopMenuTrigger
700
682
  });
701
683
  const styles = {
702
- "teddy-global-navigation": "_teddy-global-navigation_1i7an_1",
703
- "teddy-global-navigation__mobile-trigger": "_teddy-global-navigation__mobile-trigger_1i7an_6",
704
- "teddy-global-navigation__mobile-header": "_teddy-global-navigation__mobile-header_1i7an_9",
705
- "teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_1i7an_6",
706
- "teddy-global-navigation__top-icon-wrapper": "_teddy-global-navigation__top-icon-wrapper_1i7an_32",
707
- "teddy-global-navigation__top-menu-icons": "_teddy-global-navigation__top-menu-icons_1i7an_37",
708
- "teddy-global-navigation__link": "_teddy-global-navigation__link_1i7an_41",
709
- "teddy-global-navigation__header": "_teddy-global-navigation__header_1i7an_51",
710
- "teddy-global-navigation__colored-box": "_teddy-global-navigation__colored-box_1i7an_54",
711
- "teddy-global-navigation__colored-box--mobile": "_teddy-global-navigation__colored-box--mobile_1i7an_57",
712
- "teddy-global-navigation__sublink-button--mobile": "_teddy-global-navigation__sublink-button--mobile_1i7an_61",
713
- "teddy-global-navigation__list": "_teddy-global-navigation__list_1i7an_67",
714
- "teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_1i7an_72",
715
- "teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_1i7an_75",
716
- "teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_1i7an_79",
717
- "teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_1i7an_86",
718
- "close-viewport": "_close-viewport_1i7an_1",
719
- "teddy-global-navigation__top-menu-color": "_teddy-global-navigation__top-menu-color_1i7an_97",
720
- "teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_1i7an_100",
721
- "teddy-global-navigation__accordion-look": "_teddy-global-navigation__accordion-look_1i7an_117",
722
- "teddy-global-navigation__mobile-link--accordion-look": "_teddy-global-navigation__mobile-link--accordion-look_1i7an_133"
684
+ "teddy-global-navigation": "_teddy-global-navigation_19q4u_1",
685
+ "teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_19q4u_6",
686
+ "teddy-global-navigation__top-icon-wrapper": "_teddy-global-navigation__top-icon-wrapper_19q4u_26",
687
+ "teddy-global-navigation__top-menu-icons": "_teddy-global-navigation__top-menu-icons_19q4u_31",
688
+ "teddy-global-navigation__link": "_teddy-global-navigation__link_19q4u_35",
689
+ "teddy-global-navigation__header": "_teddy-global-navigation__header_19q4u_48",
690
+ "teddy-global-navigation__colored-box": "_teddy-global-navigation__colored-box_19q4u_51",
691
+ "teddy-global-navigation__colored-box--mobile": "_teddy-global-navigation__colored-box--mobile_19q4u_54",
692
+ "teddy-global-navigation__sublink-button--mobile": "_teddy-global-navigation__sublink-button--mobile_19q4u_58",
693
+ "teddy-global-navigation__list": "_teddy-global-navigation__list_19q4u_64",
694
+ "teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_19q4u_69",
695
+ "teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_19q4u_72",
696
+ "teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_19q4u_76",
697
+ "teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_19q4u_83",
698
+ "teddy-global-navigation__top-menu-color": "_teddy-global-navigation__top-menu-color_19q4u_98",
699
+ "teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_19q4u_101"
723
700
  };
724
701
  function MyPages(props) {
725
702
  var _a, _b;
@@ -821,6 +798,7 @@ const SearchField = React.forwardRef(
821
798
  SearchField.displayName = "SearchField";
822
799
  function Search(props) {
823
800
  const rootContext = React.useContext(RootContext);
801
+ const additionalSearchContent = rootContext == null ? void 0 : rootContext.additionalSearchContent;
824
802
  const searchFieldRef = React.useRef(null);
825
803
  return /* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer, { ...props, children: [
826
804
  /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsxs("button", { children: [
@@ -840,6 +818,7 @@ function Search(props) {
840
818
  /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "floating", "aria-label": "Lukk" }),
841
819
  /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: "Hva leter du etter?" }),
842
820
  /* @__PURE__ */ jsxRuntime.jsx(SearchField, { ref: searchFieldRef }),
821
+ additionalSearchContent ? additionalSearchContent : null,
843
822
  /* @__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" }) }) })
844
823
  ]
845
824
  }
@@ -885,38 +864,13 @@ const Desktop = React.forwardRef(() => {
885
864
  (link) => {
886
865
  const highlightedLinkSelected = [...link.highlightedLinks].some((highlightedLink) => highlightedLink.link === (rootContext == null ? void 0 : rootContext.pathname));
887
866
  const linkSelected = [...link.links].some((subLink) => subLink.link === (rootContext == null ? void 0 : rootContext.pathname));
888
- return linkSelected || highlightedLinkSelected || link.links.length && link.name === (rootContext == null ? void 0 : rootContext.specifiedLink);
867
+ const sameParent = link.link.split("/")[1] === (rootContext == null ? void 0 : rootContext.pathname.split("/")[1]) || !link.link && (rootContext == null ? void 0 : rootContext.pathname) === "/";
868
+ return linkSelected || highlightedLinkSelected || link.links.length && link.name === (rootContext == null ? void 0 : rootContext.specifiedLink) && sameParent;
889
869
  }
890
870
  );
891
871
  const topMenuSize = utils_useSize.useSize(topMenuRef.current);
892
872
  const topMenuHeight = (topMenuSize == null ? void 0 : topMenuSize.height) ? `${topMenuSize.height}px` : void 0;
893
- const viewPortHeight = shouldShowViewport ? "288px" : void 0;
894
- const [allowAnimationOfHeight, setAllowAnimationOfHeight] = React.useState(false);
895
- const timerRef = React.useRef(void 0);
896
- React.useEffect(() => {
897
- timerRef.current = setTimeout(() => {
898
- setAllowAnimationOfHeight(true);
899
- }, 500);
900
- return () => {
901
- timerRef.current && clearTimeout(timerRef.current);
902
- };
903
- }, []);
904
- const handleScroll = () => {
905
- const scrollY = window.scrollY;
906
- const scrollDirection = scrollY > lastScrollPos.current ? "down" : "up";
907
- if (scrollDirection !== lastScrollDirection.current) {
908
- scrollStartPos.current = scrollY;
909
- }
910
- lastScrollDirection.current = scrollDirection;
911
- lastScrollPos.current = scrollY;
912
- };
913
- const throttledScrollHandler = useDebounceCallback(handleScroll, 5);
914
- React.useEffect(() => {
915
- window.addEventListener("scroll", throttledScrollHandler);
916
- return () => {
917
- window.removeEventListener("scroll", throttledScrollHandler);
918
- };
919
- }, [throttledScrollHandler]);
873
+ const viewPortHeight = shouldShowViewport ? "293px" : void 0;
920
874
  if (!rootContext)
921
875
  return null;
922
876
  function resetAndShowMenu() {
@@ -926,13 +880,16 @@ const Desktop = React.forwardRef(() => {
926
880
  }
927
881
  const { hideMenu, selectedMenuItem, setSelectedMenuItem, linkComponent: Link2, specifiedLink, setSpecifiedLink } = rootContext;
928
882
  const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
883
+ const handleInteractions = (linkName) => {
884
+ setSpecifiedLink(linkName || "");
885
+ setSelectedMenuItem(linkName || "", true);
886
+ };
929
887
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
930
888
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles[`${rootClassName}__top-menu-color`], children: /* @__PURE__ */ jsxRuntime.jsx(
931
889
  "div",
932
890
  {
933
891
  style: utils_generateStyling_index.mergeStyles(
934
- { ["--teddy-top-menu-height"]: topMenuHeight },
935
- allowAnimationOfHeight ? { ["--teddy-motion-duration-controlled"]: tokens_motion_variables.teddyMotionDuration300 } : {}
892
+ { ["--teddy-top-menu-height"]: topMenuHeight }
936
893
  ),
937
894
  className: styles[`${rootClassName}__top-menu-wrapper`],
938
895
  children: /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.TopMenuList, { onFocus: resetAndShowMenu, ref: topMenuRef, children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.TopMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -956,52 +913,46 @@ const Desktop = React.forwardRef(() => {
956
913
  (subLink) => {
957
914
  var _a2, _b, _c;
958
915
  return /* @__PURE__ */ jsxRuntime.jsxs(NavigationMenu.Item, { value: subLink.name, children: [
959
- subLink.name === "Logo" ? /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { href: subLink.link, onClick: () => {
960
- setSelectedMenuItem("", true);
961
- setSpecifiedLink("");
962
- }, children: /* @__PURE__ */ jsxRuntime.jsx(
916
+ subLink.name === "Logo" ? /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { href: subLink.link, onMouseEnter: () => handleInteractions(), onClick: () => handleInteractions(), children: /* @__PURE__ */ jsxRuntime.jsx(
963
917
  "img",
964
918
  {
965
919
  src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
966
920
  draggable: "false",
967
921
  alt: "Telia logo"
968
922
  }
969
- ) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, onClick: () => {
970
- setSelectedMenuItem("", true);
971
- setSpecifiedLink("");
972
- }, children: /* @__PURE__ */ jsxRuntime.jsx(
973
- "img",
923
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx(
924
+ "a",
974
925
  {
975
- src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
976
- draggable: "false",
977
- alt: "Telia logo"
926
+ href: subLink.link,
927
+ onMouseEnter: () => handleInteractions(),
928
+ onClick: () => handleInteractions(),
929
+ children: /* @__PURE__ */ jsxRuntime.jsx(
930
+ "img",
931
+ {
932
+ src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
933
+ draggable: "false",
934
+ alt: "Telia logo"
935
+ }
936
+ )
978
937
  }
979
- ) }) }) : ((_a2 = subLink.links) == null ? void 0 : _a2.length) ? /* @__PURE__ */ jsxRuntime.jsx(
938
+ ) }) : ((_a2 = subLink.links) == null ? void 0 : _a2.length) ? /* @__PURE__ */ jsxRuntime.jsx(
980
939
  NavigationMenu.Trigger,
981
940
  {
982
941
  asChild: true,
983
942
  active: currentLocation === subLink.link,
984
- onClick: () => {
985
- setSpecifiedLink(subLink.name);
986
- setSelectedMenuItem(subLink.name, true);
987
- },
988
- children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { children: subLink.name })
943
+ children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), children: subLink.name })
989
944
  }
990
945
  ) : /* @__PURE__ */ jsxRuntime.jsx(
991
946
  NavigationMenu.Link,
992
947
  {
993
948
  asChild: true,
994
949
  active: selectedMenuItem === subLink.name && currentLocation === subLink.link,
995
- onClick: () => {
996
- setSpecifiedLink(subLink.name);
997
- setSelectedMenuItem(subLink.name, true);
998
- },
999
- children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, children: subLink.name })
950
+ children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), href: subLink.link, children: subLink.name })
1000
951
  }
1001
952
  ),
1002
953
  /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Content, { children: !!specifiedLink && subLink.name === specifiedLink && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1003
954
  ((_b = subLink.links) == null ? void 0 : _b.length) > 0 && /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { direction: "column", pt: "400", pl: "150", children: /* @__PURE__ */ jsxRuntime.jsx(HightlightedLinksDesktop, { listName: subLink.name, links: subLink.links }) }),
1004
- ((_c = subLink.highlightedLinks) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { direction: "column", pt: "400", pl: "400", pr: "400", pb: "40px", className: styles[`${rootClassName}__colored-box`], children: /* @__PURE__ */ jsxRuntime.jsx(HightlightedLinksDesktop, { listName: "Nyttige snarveier", links: subLink.highlightedLinks }) })
955
+ ((_c = subLink.highlightedLinks) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { direction: "column", pt: "400", pl: "400", pr: "400", pb: "250", className: styles[`${rootClassName}__colored-box`], children: /* @__PURE__ */ jsxRuntime.jsx(HightlightedLinksDesktop, { listName: "Nyttige snarveier", links: subLink.highlightedLinks }) })
1005
956
  ] }) })
1006
957
  ] }, subLink.name);
1007
958
  }
@@ -1012,13 +963,11 @@ const Desktop = React.forwardRef(() => {
1012
963
  /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(MyPages, {}) })
1013
964
  ] }, link.name);
1014
965
  }),
1015
- /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Separator, {}),
1016
966
  /* @__PURE__ */ jsxRuntime.jsx(
1017
967
  "div",
1018
968
  {
1019
969
  style: utils_generateStyling_index.mergeStyles(
1020
- { ["--teddy-viewport-wrapper-height"]: viewPortHeight },
1021
- allowAnimationOfHeight ? { ["--teddy-motion-duration-controlled"]: tokens_motion_variables.teddyMotionDuration300 } : {}
970
+ { ["--teddy-viewport-wrapper-height"]: viewPortHeight }
1022
971
  ),
1023
972
  className: styles[`${rootClassName}__viewport-wrapper`],
1024
973
  "data-state": hideMenu === null ? "" : hideMenu ? "closed" : "open",
@@ -1035,20 +984,11 @@ const Desktop = React.forwardRef(() => {
1035
984
  ] });
1036
985
  });
1037
986
  Desktop.displayName = "Desktop";
1038
- function useDebounceCallback(callback, delay) {
1039
- const handleCallback = utils_useCallbackRef.useCallbackRef(callback);
1040
- const debounceTimerRef = React.useRef(0);
1041
- React.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
1042
- return React.useCallback(() => {
1043
- window.clearTimeout(debounceTimerRef.current);
1044
- debounceTimerRef.current = window.setTimeout(handleCallback, delay);
1045
- }, [handleCallback, delay]);
1046
- }
1047
987
  const HightlightedLinksDesktop = ({ links, listName }) => {
1048
988
  const rootContext = React.useContext(RootContext);
1049
989
  if (!rootContext)
1050
990
  return null;
1051
- const { linkComponent: Link2 } = rootContext;
991
+ const { linkComponent: Link2, setSpecifiedLink, setSelectedMenuItem } = rootContext;
1052
992
  const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
1053
993
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1054
994
  /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { pl: "100", pb: "100", variant: "title-200", as: "h2", children: listName }),
@@ -1061,6 +1001,8 @@ const HightlightedLinksDesktop = ({ links, listName }) => {
1061
1001
  active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, links || []) === subSubLink.link,
1062
1002
  onClick: () => {
1063
1003
  rootContext.setPathname(subSubLink.link);
1004
+ setSpecifiedLink("");
1005
+ setSelectedMenuItem("", true);
1064
1006
  },
1065
1007
  children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", align: "center", children: [
1066
1008
  subSubLink.name,
@@ -1099,7 +1041,6 @@ function Mobile(props) {
1099
1041
  /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { ref: drawerRef, slot: "floating", "aria-label": "Lukk" }),
1100
1042
  !specifiedLink ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1101
1043
  /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: "Meny" }),
1102
- /* @__PURE__ */ jsxRuntime.jsx(SearchField, {}),
1103
1044
  /* @__PURE__ */ jsxRuntime.jsxs(
1104
1045
  components_tabs_index.Tabs,
1105
1046
  {
@@ -1245,6 +1186,7 @@ function Root({
1245
1186
  shoppingCart,
1246
1187
  shoppingCartNumberOfItems,
1247
1188
  onSearchSubmit,
1189
+ additionalSearchContent,
1248
1190
  isCartOpen,
1249
1191
  onCartOpenChange,
1250
1192
  drawerSize = "md",
@@ -1290,6 +1232,7 @@ function Root({
1290
1232
  shoppingCart,
1291
1233
  shoppingCartNumberOfItems,
1292
1234
  onSearchSubmit,
1235
+ additionalSearchContent,
1293
1236
  isCartOpen,
1294
1237
  onCartOpenChange,
1295
1238
  drawerSize,