@telia/teddy 0.2.0 → 0.2.1

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,10 +7,9 @@ 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");
10
12
  require("../../../assets/sprite.1321fab0-teddy.svg");
11
13
  require("../../icon/icon.cjs");
12
14
  require("../../flex/flex.cjs");
13
- require("../../list/index.cjs");
14
- require("../../heading/heading.cjs");
15
- require("../../button/button.cjs");
16
15
  exports.Desktop = components_radioCardGroup_radioCardGroupItemTitle.Desktop;
@@ -5,12 +5,11 @@ 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";
8
10
  import "../../../assets/sprite.1321fab0-teddy.svg";
9
11
  import "../../icon/icon.js";
10
12
  import "../../flex/flex.js";
11
- import "../../list/index.js";
12
- import "../../heading/heading.js";
13
- import "../../button/button.js";
14
13
  export {
15
14
  D as Desktop
16
15
  };
@@ -12,7 +12,8 @@ require("../../../assets/sprite.1321fab0-teddy.svg");
12
12
  require("../../icon/icon.cjs");
13
13
  require("../../tabs/index.cjs");
14
14
  require("./utils.cjs");
15
+ require("../../accordion/index.cjs");
16
+ require("../../visually-hidden/visually-hidden.cjs");
17
+ require("../../link/link.cjs");
15
18
  require("../../list/index.cjs");
16
- require("../../heading/heading.cjs");
17
- exports.HighlightedLinks = components_radioCardGroup_radioCardGroupItemTitle.HighlightedLinks;
18
19
  exports.Mobile = components_radioCardGroup_radioCardGroupItemTitle.Mobile;
@@ -1,14 +1,7 @@
1
- import { default as React, MutableRefObject } from 'react';
2
- import { Link as LinkProps } from './utils';
1
+ import { default as React } from 'react';
3
2
 
4
3
  export type MobileProps = React.ComponentPropsWithoutRef<'div'>;
5
4
  export declare function Mobile(props: MobileProps): import("react/jsx-runtime").JSX.Element | null;
6
5
  export declare namespace Mobile {
7
6
  var displayName: string;
8
7
  }
9
- export declare const HighlightedLinks: ({ listTitle, links, item, drawerRef }: {
10
- listTitle: string;
11
- links: LinkProps[];
12
- item: LinkProps;
13
- drawerRef?: MutableRefObject<HTMLButtonElement | null>;
14
- }) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { H, f } from "../../radio-card-group/radio-card-group-item-title.js";
3
+ import { f } from "../../radio-card-group/radio-card-group-item-title.js";
4
4
  import "clsx";
5
5
  import "../../flex/flex.js";
6
6
  import "../../box/box.js";
@@ -10,9 +10,10 @@ import "../../../assets/sprite.1321fab0-teddy.svg";
10
10
  import "../../icon/icon.js";
11
11
  import "../../tabs/index.js";
12
12
  import "./utils.js";
13
+ import "../../accordion/index.js";
14
+ import "../../visually-hidden/visually-hidden.js";
15
+ import "../../link/link.js";
13
16
  import "../../list/index.js";
14
- import "../../heading/heading.js";
15
17
  export {
16
- H as HighlightedLinks,
17
18
  f as Mobile
18
19
  };
@@ -13,7 +13,6 @@ 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;
17
16
  isCartOpen?: boolean;
18
17
  onCartOpenChange?: (open: boolean) => void;
19
18
  drawerSize: 'md' | 'lg';
@@ -27,11 +26,9 @@ type RootContext = {
27
26
  setSelectedDomainItem: (v: string, onlyStateChange?: boolean) => void;
28
27
  pathname: string;
29
28
  setPathname: (v: string) => void;
30
- specifiedLink?: string;
31
- setSpecifiedLink: (v: string) => void;
32
- } & Pick<RootProps, 'onSearchSubmit' | 'additionalSearchContent' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize'>;
29
+ } & Pick<RootProps, 'onSearchSubmit' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize'>;
33
30
  export declare const RootContext: React.Context<RootContext | null>;
34
- 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;
31
+ 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
32
  export declare namespace Root {
36
33
  var displayName: string;
37
34
  }
@@ -79,92 +79,17 @@ const PRIVATE_LINKS = {
79
79
  name: "Privat",
80
80
  link: "/",
81
81
  appKey: APP_KEYS["open-pages"],
82
- highlightedLinks: [
83
- {
84
- name: "Mobilabonnement",
85
- link: "/mobil/mobilabonnement/priser/",
86
- appKey: APP_KEYS["web-shop"]
87
- },
88
- {
89
- name: "Mobiltelefoner",
90
- link: "/mobil/mobiltelefoner/",
91
- appKey: APP_KEYS["web-shop"]
92
- },
93
- {
94
- name: "Varemerker ",
95
- link: "/varemerker/",
96
- appKey: APP_KEYS["web-shop"]
97
- },
98
- {
99
- name: "Kampanjer",
100
- link: "/kampanje/",
101
- appKey: APP_KEYS["open-pages"]
102
- },
103
- {
104
- name: "Faktura",
105
- link: "/hjelp/faktura/",
106
- appKey: APP_KEYS["open-pages"]
107
- },
108
- {
109
- name: "Se Telia Play",
110
- link: "https://www.teliaplay.no",
111
- appKey: APP_KEYS["open-pages"]
112
- }
113
- ],
114
82
  links: [
115
83
  {
116
84
  name: "Logo",
117
85
  link: "/",
118
86
  appKey: APP_KEYS["open-pages"],
119
- links: [],
120
- highlightedLinks: []
87
+ links: []
121
88
  },
122
89
  {
123
90
  name: "Mobil",
124
- link: "",
91
+ link: "/mobil/",
125
92
  appKey: APP_KEYS["open-pages"],
126
- highlightedLinks: [
127
- {
128
- name: "Kjøp Telia X",
129
- link: "/mobil/mobilabonnement/ubegrenset-data/",
130
- appKey: APP_KEYS["web-shop"]
131
- },
132
- {
133
- name: "Pakketilbud",
134
- link: "/mobil/mobilabonnement/pakketilbud/",
135
- appKey: APP_KEYS["web-shop"]
136
- },
137
- {
138
- name: "Kjøp iPhone",
139
- link: "/varemerker/apple/iphone/",
140
- appKey: APP_KEYS["web-shop"]
141
- },
142
- {
143
- name: "Kjøp AirPods",
144
- link: "/varemerker/apple/airpods/",
145
- appKey: APP_KEYS["web-shop"]
146
- },
147
- {
148
- name: "Kampanjer",
149
- link: "/kampanje/",
150
- appKey: APP_KEYS["open-pages"]
151
- },
152
- {
153
- name: "SIM, PIN og PUK",
154
- link: "/mobil/mobilabonnement/sim-kort/",
155
- appKey: APP_KEYS["open-pages"]
156
- },
157
- {
158
- name: "Utland",
159
- link: "/mobil/mobilabonnement/utland/",
160
- appKey: APP_KEYS["open-pages"]
161
- },
162
- {
163
- name: "Eierskifte",
164
- link: "/mobil/hjelp/bytte-eier/",
165
- appKey: APP_KEYS["open-pages"]
166
- }
167
- ],
168
93
  links: [
169
94
  {
170
95
  name: "Mobilabonnement",
@@ -191,6 +116,11 @@ const PRIVATE_LINKS = {
191
116
  link: "/mobil/tilbehor/",
192
117
  appKey: APP_KEYS["web-shop"]
193
118
  },
119
+ {
120
+ name: "Pakketilbud",
121
+ link: "/mobil/mobilabonnement/pakketilbud/",
122
+ appKey: APP_KEYS["web-shop"]
123
+ },
194
124
  {
195
125
  name: "Påfyll kontantkort",
196
126
  link: "/mobil/mobilabonnement/kontantkort/lade/",
@@ -200,59 +130,18 @@ const PRIVATE_LINKS = {
200
130
  name: "Hjelp Mobil",
201
131
  link: "/mobil/hjelp/",
202
132
  appKey: APP_KEYS["open-pages"]
203
- },
204
- {
205
- name: "Alt om mobil",
206
- link: "/mobil/",
207
- appKey: APP_KEYS["open-pages"]
208
133
  }
209
134
  ]
210
135
  },
211
136
  {
212
137
  name: "TV",
213
- link: "",
138
+ link: "/tv/",
214
139
  appKey: APP_KEYS["open-pages"],
215
- highlightedLinks: [
216
- {
217
- name: "Valgmenyen i Telia Play",
218
- link: "https://account.teliaplay.no/subscription/selection-menu",
219
- appKey: APP_KEYS["open-pages"]
220
- },
221
- {
222
- name: "Aktivere strømmetjenester",
223
- link: "/tv/innholdsoversikt/strommetjenester/#registrere",
224
- appKey: APP_KEYS["open-pages"]
225
- },
226
- {
227
- name: "Kjøp Premier League",
228
- link: "/tv/innholdsoversikt/premiumtjenester/premier-league-v-premium/",
229
- appKey: APP_KEYS["open-pages"]
230
- },
231
- {
232
- name: "Kampanjer",
233
- link: "/kampanje/",
234
- appKey: APP_KEYS["open-pages"]
235
- },
236
- {
237
- name: "Kom i gang med Telia Play",
238
- link: "/tv/hjelp/kom-i-gang/",
239
- appKey: APP_KEYS["open-pages"]
240
- },
241
- {
242
- name: "Slik bruker du Telia Play",
243
- link: "/tv/hjelp/daglig-bruk/",
244
- appKey: APP_KEYS["open-pages"]
245
- },
246
- {
247
- name: "Driftsmeldinger og feilsøk",
248
- link: "/tv/hjelp/tv-feilsok/tv-hjelp-utstyr/",
249
- appKey: APP_KEYS["open-pages"]
250
- }
251
- ],
252
140
  links: [
253
141
  {
254
142
  name: "Se Telia Play",
255
143
  link: "https://www.teliaplay.no",
144
+ icon: "external",
256
145
  appKey: APP_KEYS["open-pages"]
257
146
  },
258
147
  {
@@ -265,11 +154,21 @@ const PRIVATE_LINKS = {
265
154
  link: "/tv/innholdsoversikt/strommetjenester/",
266
155
  appKey: APP_KEYS["open-pages"]
267
156
  },
157
+ // {
158
+ // name: 'TV-kanaler',
159
+ // link: '/tv/tv-kanaler-og-kanalpakker/',
160
+ // appKey: APP_KEYS['open-pages'],
161
+ // },
268
162
  {
269
163
  name: "Premiumtjenester",
270
164
  link: "/tv/innholdsoversikt/premiumtjenester/",
271
165
  appKey: APP_KEYS["open-pages"]
272
166
  },
167
+ // {
168
+ // name: 'Filmer',
169
+ // link: '/tv/filmleie-og-filmkjop/',
170
+ // appKey: APP_KEYS['open-pages'],
171
+ // },
273
172
  {
274
173
  name: "TV-bokser",
275
174
  link: "/tv/tv-bokser/",
@@ -279,50 +178,13 @@ const PRIVATE_LINKS = {
279
178
  name: "Hjelp TV",
280
179
  link: "/tv/hjelp/",
281
180
  appKey: APP_KEYS["open-pages"]
282
- },
283
- {
284
- name: "Alt om TV",
285
- link: "/tv/",
286
- appKey: APP_KEYS["open-pages"]
287
181
  }
288
182
  ]
289
183
  },
290
184
  {
291
185
  name: "Internett",
292
- link: "",
186
+ link: "/internett/",
293
187
  appKey: APP_KEYS["open-pages"],
294
- highlightedLinks: [
295
- {
296
- name: "Søk på adresse",
297
- link: "/internett/sok-adresse/",
298
- appKey: APP_KEYS["open-pages"]
299
- },
300
- {
301
- name: "Kjøp bredbånd til hytta",
302
- link: "/internett/tradlost-bredband-hytte/",
303
- appKey: APP_KEYS["open-pages"]
304
- },
305
- {
306
- name: "Kampanjer",
307
- link: "/kampanje/",
308
- appKey: APP_KEYS["open-pages"]
309
- },
310
- {
311
- name: "Problemer med internett",
312
- link: "/internett/internett-problemer/",
313
- appKey: APP_KEYS["open-pages"]
314
- },
315
- {
316
- name: "Ruterer og innstillinger",
317
- link: "/internett/wifi/rutere/",
318
- appKey: APP_KEYS["open-pages"]
319
- },
320
- {
321
- name: "WiFi-tips",
322
- link: "/internett/wifi/wifi-tips/",
323
- appKey: APP_KEYS["open-pages"]
324
- }
325
- ],
326
188
  links: [
327
189
  {
328
190
  name: "Fast bredbånd",
@@ -358,60 +220,13 @@ const PRIVATE_LINKS = {
358
220
  name: "Hjelp Internett",
359
221
  link: "/internett/hjelp/",
360
222
  appKey: APP_KEYS["open-pages"]
361
- },
362
- {
363
- name: "Alt om internett",
364
- link: "/internett/",
365
- appKey: APP_KEYS["open-pages"]
366
223
  }
367
224
  ]
368
225
  },
369
226
  {
370
227
  name: "Trygghet",
371
- link: "",
228
+ link: "/trygghet/",
372
229
  appKey: APP_KEYS["open-pages"],
373
- highlightedLinks: [
374
- {
375
- name: "Telia Trygg",
376
- link: "/trygghet/tjenester/telia-trygg/",
377
- appKey: APP_KEYS["open-pages"]
378
- },
379
- {
380
- name: "Mobilforsikring",
381
- link: "/trygghet/tjenester/mobilforsikring/",
382
- appKey: APP_KEYS["open-pages"]
383
- },
384
- {
385
- name: "Telia Sky",
386
- link: "/trygghet/tjenester/telia-sky/",
387
- appKey: APP_KEYS["open-pages"]
388
- },
389
- {
390
- name: "Trygg mobil for barn",
391
- link: "/trygghet/trygg-pa-skjerm/trygg-mobil-til-barn/",
392
- appKey: APP_KEYS["open-pages"]
393
- },
394
- {
395
- name: "Ta styring over skjermtiden",
396
- link: "/trygghet/skjermhelse/skjermtid/",
397
- appKey: APP_KEYS["open-pages"]
398
- },
399
- {
400
- name: "Falske nettbutikker",
401
- link: "/trygghet/svindel/falske-nettbutikker/",
402
- appKey: APP_KEYS["open-pages"]
403
- },
404
- {
405
- name: "ID-tyveri",
406
- link: "/trygghet/svindel/id-tyveri/",
407
- appKey: APP_KEYS["open-pages"]
408
- },
409
- {
410
- name: "Lynkurs - trygg på skjerm",
411
- link: "/trygghet/trygg-pa-skjerm/lynkurs/",
412
- appKey: APP_KEYS["open-pages"]
413
- }
414
- ],
415
230
  links: [
416
231
  {
417
232
  name: "Tjenester",
@@ -442,50 +257,13 @@ const PRIVATE_LINKS = {
442
257
  name: "Hjelp Trygghet",
443
258
  link: "/trygghet/hjelp/",
444
259
  appKey: APP_KEYS["open-pages"]
445
- },
446
- {
447
- name: "Alt om trygghet",
448
- link: "/trygghet/",
449
- appKey: APP_KEYS["open-pages"]
450
260
  }
451
261
  ]
452
262
  },
453
263
  {
454
264
  name: "Hjelp",
455
- link: "",
265
+ link: "/hjelp/",
456
266
  appKey: APP_KEYS["open-pages"],
457
- highlightedLinks: [
458
- {
459
- name: "SIM, PIN og PUK",
460
- link: "/mobil/mobilabonnement/sim-kort/",
461
- appKey: APP_KEYS["open-pages"]
462
- },
463
- {
464
- name: "Driftsmeldinger",
465
- link: "/hjelp/driftsmeldinger/",
466
- appKey: APP_KEYS["open-pages"]
467
- },
468
- {
469
- name: "Dekningskart",
470
- link: "/nett/dekning/",
471
- appKey: APP_KEYS["open-pages"]
472
- },
473
- {
474
- name: "Returnere rutere og TV-bokser",
475
- link: "/hjelp/retur-av-utstyr/",
476
- appKey: APP_KEYS["open-pages"]
477
- },
478
- {
479
- name: "Last ned apper",
480
- link: "/hjelp/apper/",
481
- appKey: APP_KEYS["open-pages"]
482
- },
483
- {
484
- name: "Se din faktura",
485
- link: "/minside/faktura/",
486
- appKey: APP_KEYS["my-pages"]
487
- }
488
- ],
489
267
  links: [
490
268
  {
491
269
  name: "Hjelp Mobil",
@@ -521,11 +299,6 @@ const PRIVATE_LINKS = {
521
299
  name: "Finn butikk",
522
300
  link: "/hjelp/butikker-og-forhandlere/",
523
301
  appKey: APP_KEYS["open-pages"]
524
- },
525
- {
526
- name: "Hjelp til alt",
527
- link: "/hjelp/",
528
- appKey: APP_KEYS["open-pages"]
529
302
  }
530
303
  // {
531
304
  // name: 'Kontakt oss',
@@ -540,41 +313,35 @@ const BUSINESS_LINKS = {
540
313
  name: "Bedrift",
541
314
  link: "/bedrift/",
542
315
  appKey: APP_KEYS["open-pages"],
543
- highlightedLinks: [],
544
316
  links: [
545
317
  {
546
318
  name: "Logo",
547
319
  link: "/bedrift/",
548
320
  appKey: APP_KEYS["open-pages"],
549
- links: [],
550
- highlightedLinks: []
321
+ links: []
551
322
  },
552
323
  {
553
324
  name: "Produkter og tjenester",
554
325
  link: "/bedrift/produkter-og-tjenester/",
555
326
  appKey: APP_KEYS["open-pages"],
556
- links: [],
557
- highlightedLinks: []
327
+ links: []
558
328
  },
559
329
  {
560
330
  name: "Sikkerhet",
561
331
  link: "/bedrift/sikkerhet/",
562
332
  appKey: APP_KEYS["open-pages"],
563
- links: [],
564
- highlightedLinks: []
333
+ links: []
565
334
  },
566
335
  {
567
336
  name: "Innovasjon",
568
337
  link: "/bedrift/innovasjon-og-startup/",
569
338
  appKey: APP_KEYS["open-pages"],
570
- links: [],
571
- highlightedLinks: []
339
+ links: []
572
340
  },
573
341
  {
574
342
  name: "Nettbutikk",
575
343
  link: "/bedrift/mobilabonnement/",
576
344
  appKey: APP_KEYS["open-pages"],
577
- highlightedLinks: [],
578
345
  links: [
579
346
  {
580
347
  name: "Mobilabonnement",
@@ -597,8 +364,7 @@ const BUSINESS_LINKS = {
597
364
  name: "Hjelp",
598
365
  link: "/bedrift/kundeservice/",
599
366
  appKey: APP_KEYS["open-pages"],
600
- links: [],
601
- highlightedLinks: []
367
+ links: []
602
368
  }
603
369
  ]
604
370
  };
@@ -606,35 +372,30 @@ const MDU_LINKS = {
606
372
  name: "Borettslag",
607
373
  link: "/borettslag/",
608
374
  appKey: APP_KEYS["open-pages"],
609
- highlightedLinks: [],
610
375
  links: [
611
376
  {
612
377
  name: "Logo",
613
378
  link: "/borettslag/",
614
379
  appKey: APP_KEYS["open-pages"],
615
- links: [],
616
- highlightedLinks: []
380
+ links: []
617
381
  },
618
382
  {
619
383
  name: "Beboer",
620
384
  link: "/borettslag/beboer/",
621
385
  appKey: APP_KEYS["open-pages"],
622
- links: [],
623
- highlightedLinks: []
386
+ links: []
624
387
  },
625
388
  {
626
389
  name: "Styre",
627
390
  link: "/borettslag/styre/",
628
391
  appKey: APP_KEYS["open-pages"],
629
- links: [],
630
- highlightedLinks: []
392
+ links: []
631
393
  },
632
394
  {
633
395
  name: "Utbygger",
634
396
  link: "/borettslag/utbygger/",
635
397
  appKey: APP_KEYS["open-pages"],
636
- links: [],
637
- highlightedLinks: []
398
+ links: []
638
399
  }
639
400
  ]
640
401
  };
@@ -642,7 +403,7 @@ const LINKS = [PRIVATE_LINKS, BUSINESS_LINKS, MDU_LINKS];
642
403
  const getActiveSubLink = (path, links) => {
643
404
  let activeLink = "";
644
405
  links.forEach((link) => {
645
- if (path === link.link && link.link.length > activeLink.length) {
406
+ if (path.startsWith(link.link) && link.link.length > activeLink.length) {
646
407
  activeLink = link.link;
647
408
  }
648
409
  });