@newskit-render/core 1.42.3 → 1.45.0
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/CHANGELOG.md +95 -0
- package/__tests__/pages/[articleSlug].test.tsx +59 -18
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +46 -21
- package/components/article/Highlights.tsx +4 -33
- package/components/article/RelatedArticles.tsx +4 -53
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +99 -64
- package/components/common/NewskitLogo.tsx +5 -3
- package/components/common/NewskitLogoShort.tsx +6 -4
- package/components/common/iconNavLink/IconNavLink.tsx +70 -0
- package/components/common/iconNavLink/__tests__/IconNavLink.test.tsx +35 -0
- package/components/common/iconNavLink/index.ts +3 -0
- package/components/common/iconNavLink/types.ts +24 -0
- package/components/common/icons/IconAccount.tsx +13 -0
- package/components/footer/__snapshots__/index.test.tsx.snap +6 -4
- package/components/header/index.test.tsx +17 -0
- package/components/header/index.tsx +32 -18
- package/cypress/e2e/account/account-page.spec.js +27 -1
- package/cypress/e2e/account/account-subscription.spec.js +45 -0
- package/cypress/e2e/account/main-api.spec.js +4 -4
- package/cypress/support/commands.js +7 -3
- package/package.json +8 -7
- package/pages/[section]/[articleId]/[articleSlug].tsx +14 -3
- package/pages/api/news-sitemap.ts +10 -2
- package/pages/api/sitemap.ts +10 -6
- package/temp/_app.tsx +209 -0
- package/temp/header.tsx +32 -18
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
exports[`Article should render tile and sub title 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
.emotion-0 {
|
|
6
|
-
height:
|
|
6
|
+
height: 80px;
|
|
7
|
+
background-color: #3358CC;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.emotion-0 a,
|
|
@@ -15,8 +16,8 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
15
16
|
|
|
16
17
|
@media screen {
|
|
17
18
|
.emotion-0 {
|
|
18
|
-
padding-top:
|
|
19
|
-
padding-bottom:
|
|
19
|
+
padding-top: 16px;
|
|
20
|
+
padding-bottom: 16px;
|
|
20
21
|
padding-left: 0;
|
|
21
22
|
padding-right: 0;
|
|
22
23
|
}
|
|
@@ -24,8 +25,8 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
24
25
|
|
|
25
26
|
@media screen and (min-width: 1024px) {
|
|
26
27
|
.emotion-0 {
|
|
27
|
-
padding-top:
|
|
28
|
-
padding-bottom:
|
|
28
|
+
padding-top: 16px;
|
|
29
|
+
padding-bottom: 16px;
|
|
29
30
|
padding-left: 64px;
|
|
30
31
|
padding-right: 64px;
|
|
31
32
|
}
|
|
@@ -279,16 +280,19 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
279
280
|
overflow: auto;
|
|
280
281
|
width: 100%;
|
|
281
282
|
min-height: 100vh;
|
|
282
|
-
background-color: #
|
|
283
|
+
background-color: #3358CC;
|
|
283
284
|
left: 0;
|
|
284
|
-
top:
|
|
285
|
-
z-index:
|
|
285
|
+
top: 80px;
|
|
286
|
+
z-index: 2;
|
|
286
287
|
display: none;
|
|
287
288
|
}
|
|
288
289
|
|
|
289
290
|
@media screen and (min-width: 768px) {
|
|
290
291
|
.emotion-12 {
|
|
291
|
-
display:
|
|
292
|
+
display: -webkit-box;
|
|
293
|
+
display: -webkit-flex;
|
|
294
|
+
display: -ms-flexbox;
|
|
295
|
+
display: flex;
|
|
292
296
|
position: relative;
|
|
293
297
|
overflow: hidden;
|
|
294
298
|
width: initial;
|
|
@@ -297,6 +301,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
297
301
|
left: initial;
|
|
298
302
|
top: initial;
|
|
299
303
|
z-index: 1;
|
|
304
|
+
height: 48px;
|
|
300
305
|
}
|
|
301
306
|
}
|
|
302
307
|
|
|
@@ -341,7 +346,19 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
341
346
|
|
|
342
347
|
@media screen and (min-width: 768px) {
|
|
343
348
|
.emotion-14 {
|
|
344
|
-
margin-right:
|
|
349
|
+
margin-right: 16px;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@media screen and (max-width: 767px) {
|
|
354
|
+
.emotion-14 {
|
|
355
|
+
margin-bottom: 24px;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@media screen and (min-width: 768px) {
|
|
360
|
+
.emotion-14 {
|
|
361
|
+
margin-bottom: 0;
|
|
345
362
|
}
|
|
346
363
|
}
|
|
347
364
|
|
|
@@ -432,15 +449,17 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
432
449
|
/>
|
|
433
450
|
<path
|
|
434
451
|
d="M61.846.936c3.35.413 4.944 4.005 4.92 8.746l.017-.013c-5.497 4.462-16.323 7.515-26.958 1.71l.011-.016c1.568.832 3.224 1.475 5.172 1.715 2.386.294 4.303-1.023 6.043-2.889l.124-.134.062-.068.123-.137.123-.138.122-.14.121-.142.061-.071.121-.144.12-.145.146-.178.073-.09.182-.226.181-.228.144-.184.144-.185.143-.185.215-.279 1.091-1.431.209-.271.209-.269.14-.178.14-.177.14-.175.141-.173.141-.172.113-.136.113-.135.114-.133.114-.132.057-.065.114-.13.057-.064.115-.127.173-.187.116-.123.175-.18.117-.118C58.328 1.663 59.933.7 61.846.936z"
|
|
435
|
-
fill="
|
|
452
|
+
fill="white"
|
|
436
453
|
/>
|
|
437
454
|
<path
|
|
438
455
|
d="M26.763 28.981l.011.013c-1.414-.671-2.883-1.176-4.519-1.378-1.738-.214-3.244.513-4.634 1.704l-.11.095-.163.146-.108.1-.108.101-.268.261-.106.107-.106.109-.106.11-.053.056-.105.112-.053.057-.125.136-.124.138-.124.139-.062.07-.123.142-.123.143-.122.145-.122.146-.061.073-.15.183-.075.092-.149.185-.075.093-.149.187-.149.188-.223.283-.296.38-.671.866-.222.285-.222.283-.148.188-.223.28-.149.185-.149.183-.149.182-.15.18-.117.139-.118.138-.118.136-.118.135-.119.133-.119.132-.119.13-.06.064-.12.127-.1.104-.1.103-.1.101-.151.15-.101.098-.102.096-.051.048-.102.094-.206.183-.103.089-.052.044-.104.086c-1.302 1.066-2.706 1.698-4.305 1.5-3.321-.41-4.98-3.93-5.064-8.601l-.097.09c6.351-5.963 17.155-6.757 26.506-2.264z"
|
|
439
|
-
fill="
|
|
456
|
+
fill="white"
|
|
457
|
+
fill-opacity="0.4"
|
|
440
458
|
/>
|
|
441
459
|
<path
|
|
442
460
|
d="M42.216 35.925c-2.861-.398-5.212-1.275-7.302-2.318l-.189-.095-.188-.096-.186-.097-.231-.122-.229-.123-.182-.099-.226-.125-.224-.126-.178-.101-.177-.102-.264-.153-.349-.205-.278-.166-.276-.166-.411-.249-1.214-.738-.334-.201-.333-.199-2.669-1.45-.012-.013c-9.258-4.447-19.94-3.714-26.315 2.087l-.095.088C.156 20.101 8.779 2.598 25.068 4.608c2.854.352 5.141 1.176 7.14 2.181l.178.09.177.091.175.092.087.046.173.093.172.094.17.095.085.048.211.12.209.121.166.097.165.098.164.098.163.099.162.099.161.099.16.1.261.164.13.082.258.164.256.164 1.137.733.25.161.25.159.312.197.312.194a31.02 31.02 0 0 0 1.568.911l.199.106c10.506 5.694 21.166 2.775 26.7-1.604l.149-.12c-.055 10.998-8.815 28.185-24.55 26.243z"
|
|
443
|
-
fill="
|
|
461
|
+
fill="white"
|
|
462
|
+
fill-opacity="0.701961"
|
|
444
463
|
/>
|
|
445
464
|
</svg>
|
|
446
465
|
</div>
|
|
@@ -449,7 +468,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
449
468
|
>
|
|
450
469
|
<svg
|
|
451
470
|
class="emotion-8"
|
|
452
|
-
height="
|
|
471
|
+
height="48px"
|
|
453
472
|
viewBox="0 0 244 40"
|
|
454
473
|
>
|
|
455
474
|
<title>
|
|
@@ -457,15 +476,17 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
457
476
|
</title>
|
|
458
477
|
<path
|
|
459
478
|
d="M61.846.936c3.35.413 4.944 4.005 4.92 8.746l.017-.013c-5.497 4.462-16.323 7.515-26.958 1.71l.011-.016c1.568.832 3.224 1.475 5.172 1.715 2.386.294 4.303-1.023 6.043-2.889l.124-.134.062-.068.123-.137.123-.138.122-.14.121-.142.061-.071.121-.144.12-.145.146-.178.073-.09.182-.226.181-.228.144-.184.144-.185.143-.185.215-.279 1.091-1.431.209-.271.209-.269.14-.178.14-.177.14-.175.141-.173.141-.172.113-.136.113-.135.114-.133.114-.132.057-.065.114-.13.057-.064.115-.127.173-.187.116-.123.175-.18.117-.118C58.328 1.663 59.933.7 61.846.936z"
|
|
460
|
-
fill="
|
|
479
|
+
fill="white"
|
|
461
480
|
/>
|
|
462
481
|
<path
|
|
463
482
|
d="M26.763 28.981l.011.013c-1.414-.671-2.883-1.176-4.519-1.378-1.738-.214-3.244.513-4.634 1.704l-.11.095-.163.146-.108.1-.108.101-.268.261-.106.107-.106.109-.106.11-.053.056-.105.112-.053.057-.125.136-.124.138-.124.139-.062.07-.123.142-.123.143-.122.145-.122.146-.061.073-.15.183-.075.092-.149.185-.075.093-.149.187-.149.188-.223.283-.296.38-.671.866-.222.285-.222.283-.148.188-.223.28-.149.185-.149.183-.149.182-.15.18-.117.139-.118.138-.118.136-.118.135-.119.133-.119.132-.119.13-.06.064-.12.127-.1.104-.1.103-.1.101-.151.15-.101.098-.102.096-.051.048-.102.094-.206.183-.103.089-.052.044-.104.086c-1.302 1.066-2.706 1.698-4.305 1.5-3.321-.41-4.98-3.93-5.064-8.601l-.097.09c6.351-5.963 17.155-6.757 26.506-2.264z"
|
|
464
|
-
fill="
|
|
483
|
+
fill="white"
|
|
484
|
+
fill-opacity="0.4"
|
|
465
485
|
/>
|
|
466
486
|
<path
|
|
467
487
|
d="M42.216 35.925c-2.861-.398-5.212-1.275-7.302-2.318l-.189-.095-.188-.096-.186-.097-.231-.122-.229-.123-.182-.099-.226-.125-.224-.126-.178-.101-.177-.102-.264-.153-.349-.205-.278-.166-.276-.166-.411-.249-1.214-.738-.334-.201-.333-.199-2.669-1.45-.012-.013c-9.258-4.447-19.94-3.714-26.315 2.087l-.095.088C.156 20.101 8.779 2.598 25.068 4.608c2.854.352 5.141 1.176 7.14 2.181l.178.09.177.091.175.092.087.046.173.093.172.094.17.095.085.048.211.12.209.121.166.097.165.098.164.098.163.099.162.099.161.099.16.1.261.164.13.082.258.164.256.164 1.137.733.25.161.25.159.312.197.312.194a31.02 31.02 0 0 0 1.568.911l.199.106c10.506 5.694 21.166 2.775 26.7-1.604l.149-.12c-.055 10.998-8.815 28.185-24.55 26.243z"
|
|
468
|
-
fill="
|
|
488
|
+
fill="white"
|
|
489
|
+
fill-opacity="0.701961"
|
|
469
490
|
/>
|
|
470
491
|
</svg>
|
|
471
492
|
</div>
|
|
@@ -476,9 +497,11 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
476
497
|
>
|
|
477
498
|
<div
|
|
478
499
|
class="emotion-12"
|
|
500
|
+
data-testid="NavigationContainer"
|
|
479
501
|
>
|
|
480
502
|
<div
|
|
481
503
|
class="emotion-13"
|
|
504
|
+
data-testid="Navigation"
|
|
482
505
|
>
|
|
483
506
|
<span
|
|
484
507
|
class="emotion-14"
|
|
@@ -2724,7 +2747,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2724
2747
|
}
|
|
2725
2748
|
|
|
2726
2749
|
@media screen and (max-width: 767px) {
|
|
2727
|
-
.emotion-
|
|
2750
|
+
.emotion-222 {
|
|
2728
2751
|
font-family: "Bitter",serif;
|
|
2729
2752
|
font-size: 20px;
|
|
2730
2753
|
line-height: 22.5px;
|
|
@@ -2733,13 +2756,13 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2733
2756
|
padding: 0.5px 0px;
|
|
2734
2757
|
}
|
|
2735
2758
|
|
|
2736
|
-
.emotion-
|
|
2759
|
+
.emotion-222::before {
|
|
2737
2760
|
content: '';
|
|
2738
2761
|
margin-bottom: -0.2055em;
|
|
2739
2762
|
display: block;
|
|
2740
2763
|
}
|
|
2741
2764
|
|
|
2742
|
-
.emotion-
|
|
2765
|
+
.emotion-222::after {
|
|
2743
2766
|
content: '';
|
|
2744
2767
|
margin-top: -0.2275em;
|
|
2745
2768
|
display: block;
|
|
@@ -2747,7 +2770,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2747
2770
|
}
|
|
2748
2771
|
|
|
2749
2772
|
@media screen and (min-width: 768px) and (max-width: 1439px) {
|
|
2750
|
-
.emotion-
|
|
2773
|
+
.emotion-222 {
|
|
2751
2774
|
font-family: "Bitter",serif;
|
|
2752
2775
|
font-size: 22px;
|
|
2753
2776
|
line-height: 24.75px;
|
|
@@ -2756,13 +2779,13 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2756
2779
|
padding: 0.5px 0px;
|
|
2757
2780
|
}
|
|
2758
2781
|
|
|
2759
|
-
.emotion-
|
|
2782
|
+
.emotion-222::before {
|
|
2760
2783
|
content: '';
|
|
2761
2784
|
margin-bottom: -0.2055em;
|
|
2762
2785
|
display: block;
|
|
2763
2786
|
}
|
|
2764
2787
|
|
|
2765
|
-
.emotion-
|
|
2788
|
+
.emotion-222::after {
|
|
2766
2789
|
content: '';
|
|
2767
2790
|
margin-top: -0.2275em;
|
|
2768
2791
|
display: block;
|
|
@@ -2770,7 +2793,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2770
2793
|
}
|
|
2771
2794
|
|
|
2772
2795
|
@media screen and (min-width: 1440px) {
|
|
2773
|
-
.emotion-
|
|
2796
|
+
.emotion-222 {
|
|
2774
2797
|
font-family: "Bitter",serif;
|
|
2775
2798
|
font-size: 24px;
|
|
2776
2799
|
line-height: 27px;
|
|
@@ -2779,30 +2802,30 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2779
2802
|
padding: 0.5px 0px;
|
|
2780
2803
|
}
|
|
2781
2804
|
|
|
2782
|
-
.emotion-
|
|
2805
|
+
.emotion-222::before {
|
|
2783
2806
|
content: '';
|
|
2784
2807
|
margin-bottom: -0.2055em;
|
|
2785
2808
|
display: block;
|
|
2786
2809
|
}
|
|
2787
2810
|
|
|
2788
|
-
.emotion-
|
|
2811
|
+
.emotion-222::after {
|
|
2789
2812
|
content: '';
|
|
2790
2813
|
margin-top: -0.2275em;
|
|
2791
2814
|
display: block;
|
|
2792
2815
|
}
|
|
2793
2816
|
}
|
|
2794
2817
|
|
|
2795
|
-
.emotion-
|
|
2818
|
+
.emotion-225 {
|
|
2796
2819
|
margin: 0;
|
|
2797
2820
|
color: #0A0A0A;
|
|
2798
2821
|
}
|
|
2799
2822
|
|
|
2800
|
-
.emotion-
|
|
2823
|
+
.emotion-225 svg {
|
|
2801
2824
|
fill: #0A0A0A;
|
|
2802
2825
|
}
|
|
2803
2826
|
|
|
2804
2827
|
@media screen and (max-width: 767px) {
|
|
2805
|
-
.emotion-
|
|
2828
|
+
.emotion-225 {
|
|
2806
2829
|
font-family: "DM Sans",sans-serif;
|
|
2807
2830
|
font-size: 14px;
|
|
2808
2831
|
line-height: 21px;
|
|
@@ -2811,13 +2834,13 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2811
2834
|
padding: 0.5px 0px;
|
|
2812
2835
|
}
|
|
2813
2836
|
|
|
2814
|
-
.emotion-
|
|
2837
|
+
.emotion-225::before {
|
|
2815
2838
|
content: '';
|
|
2816
2839
|
margin-bottom: -0.391em;
|
|
2817
2840
|
display: block;
|
|
2818
2841
|
}
|
|
2819
2842
|
|
|
2820
|
-
.emotion-
|
|
2843
|
+
.emotion-225::after {
|
|
2821
2844
|
content: '';
|
|
2822
2845
|
margin-top: -0.409em;
|
|
2823
2846
|
display: block;
|
|
@@ -2825,7 +2848,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2825
2848
|
}
|
|
2826
2849
|
|
|
2827
2850
|
@media screen and (min-width: 768px) {
|
|
2828
|
-
.emotion-
|
|
2851
|
+
.emotion-225 {
|
|
2829
2852
|
font-family: "DM Sans",sans-serif;
|
|
2830
2853
|
font-size: 16px;
|
|
2831
2854
|
line-height: 24px;
|
|
@@ -2834,13 +2857,13 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2834
2857
|
padding: 0.5px 0px;
|
|
2835
2858
|
}
|
|
2836
2859
|
|
|
2837
|
-
.emotion-
|
|
2860
|
+
.emotion-225::before {
|
|
2838
2861
|
content: '';
|
|
2839
2862
|
margin-bottom: -0.391em;
|
|
2840
2863
|
display: block;
|
|
2841
2864
|
}
|
|
2842
2865
|
|
|
2843
|
-
.emotion-
|
|
2866
|
+
.emotion-225::after {
|
|
2844
2867
|
content: '';
|
|
2845
2868
|
margin-top: -0.409em;
|
|
2846
2869
|
display: block;
|
|
@@ -2848,37 +2871,37 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
2848
2871
|
}
|
|
2849
2872
|
|
|
2850
2873
|
@media screen {
|
|
2851
|
-
.emotion-
|
|
2874
|
+
.emotion-242 {
|
|
2852
2875
|
display: block;
|
|
2853
2876
|
}
|
|
2854
2877
|
}
|
|
2855
2878
|
|
|
2856
2879
|
@media screen and (min-width: 480px) {
|
|
2857
|
-
.emotion-
|
|
2880
|
+
.emotion-242 {
|
|
2858
2881
|
display: none;
|
|
2859
2882
|
}
|
|
2860
2883
|
}
|
|
2861
2884
|
|
|
2862
2885
|
@media screen and (min-width: 768px) {
|
|
2863
|
-
.emotion-
|
|
2886
|
+
.emotion-242 {
|
|
2864
2887
|
display: none;
|
|
2865
2888
|
}
|
|
2866
2889
|
}
|
|
2867
2890
|
|
|
2868
2891
|
@media screen and (min-width: 1024px) {
|
|
2869
|
-
.emotion-
|
|
2892
|
+
.emotion-242 {
|
|
2870
2893
|
display: block;
|
|
2871
2894
|
}
|
|
2872
2895
|
}
|
|
2873
2896
|
|
|
2874
2897
|
@media screen and (min-width: 1440px) {
|
|
2875
|
-
.emotion-
|
|
2898
|
+
.emotion-242 {
|
|
2876
2899
|
display: none;
|
|
2877
2900
|
}
|
|
2878
2901
|
}
|
|
2879
2902
|
|
|
2880
2903
|
@media screen {
|
|
2881
|
-
.emotion-
|
|
2904
|
+
.emotion-255 {
|
|
2882
2905
|
margin-bottom: 64px;
|
|
2883
2906
|
}
|
|
2884
2907
|
}
|
|
@@ -3717,7 +3740,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
3717
3740
|
>
|
|
3718
3741
|
<a
|
|
3719
3742
|
class="nk-card-link emotion-166"
|
|
3720
|
-
href="
|
|
3743
|
+
href="undefined"
|
|
3721
3744
|
>
|
|
3722
3745
|
<section
|
|
3723
3746
|
class="emotion-167"
|
|
@@ -3768,7 +3791,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
3768
3791
|
>
|
|
3769
3792
|
<a
|
|
3770
3793
|
class="nk-card-link emotion-166"
|
|
3771
|
-
href="
|
|
3794
|
+
href="undefined"
|
|
3772
3795
|
>
|
|
3773
3796
|
<section
|
|
3774
3797
|
class="emotion-167"
|
|
@@ -3968,21 +3991,26 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
3968
3991
|
<div
|
|
3969
3992
|
class="emotion-220"
|
|
3970
3993
|
>
|
|
3971
|
-
<
|
|
3972
|
-
class="emotion-
|
|
3994
|
+
<a
|
|
3995
|
+
class="nk-card-link emotion-166"
|
|
3996
|
+
href="undefined"
|
|
3973
3997
|
>
|
|
3974
|
-
<
|
|
3975
|
-
class="
|
|
3998
|
+
<section
|
|
3999
|
+
class="emotion-222"
|
|
3976
4000
|
>
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
4001
|
+
<h6
|
|
4002
|
+
class="nk-headline-heading emotion-168"
|
|
4003
|
+
>
|
|
4004
|
+
Prince Harry
|
|
4005
|
+
</h6>
|
|
4006
|
+
</section>
|
|
4007
|
+
</a>
|
|
3980
4008
|
</div>
|
|
3981
4009
|
<div
|
|
3982
4010
|
class="emotion-220"
|
|
3983
4011
|
>
|
|
3984
4012
|
<p
|
|
3985
|
-
class="emotion-
|
|
4013
|
+
class="emotion-225"
|
|
3986
4014
|
>
|
|
3987
4015
|
news
|
|
3988
4016
|
</p>
|
|
@@ -4027,21 +4055,26 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
4027
4055
|
<div
|
|
4028
4056
|
class="emotion-220"
|
|
4029
4057
|
>
|
|
4030
|
-
<
|
|
4031
|
-
class="emotion-
|
|
4058
|
+
<a
|
|
4059
|
+
class="nk-card-link emotion-166"
|
|
4060
|
+
href="undefined"
|
|
4032
4061
|
>
|
|
4033
|
-
<
|
|
4034
|
-
class="
|
|
4062
|
+
<section
|
|
4063
|
+
class="emotion-222"
|
|
4035
4064
|
>
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4065
|
+
<h6
|
|
4066
|
+
class="nk-headline-heading emotion-168"
|
|
4067
|
+
>
|
|
4068
|
+
Meghan Markle
|
|
4069
|
+
</h6>
|
|
4070
|
+
</section>
|
|
4071
|
+
</a>
|
|
4039
4072
|
</div>
|
|
4040
4073
|
<div
|
|
4041
4074
|
class="emotion-220"
|
|
4042
4075
|
>
|
|
4043
4076
|
<p
|
|
4044
|
-
class="emotion-
|
|
4077
|
+
class="emotion-225"
|
|
4045
4078
|
>
|
|
4046
4079
|
news
|
|
4047
4080
|
</p>
|
|
@@ -4055,7 +4088,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
4055
4088
|
class="emotion-181"
|
|
4056
4089
|
>
|
|
4057
4090
|
<div
|
|
4058
|
-
class="emotion-
|
|
4091
|
+
class="emotion-242"
|
|
4059
4092
|
>
|
|
4060
4093
|
<hr
|
|
4061
4094
|
aria-hidden="true"
|
|
@@ -4125,7 +4158,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
4125
4158
|
data-testid="PageLayout"
|
|
4126
4159
|
>
|
|
4127
4160
|
<div
|
|
4128
|
-
class="emotion-
|
|
4161
|
+
class="emotion-255"
|
|
4129
4162
|
/>
|
|
4130
4163
|
</div>
|
|
4131
4164
|
</div>
|
|
@@ -4384,7 +4417,7 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
4384
4417
|
>
|
|
4385
4418
|
<svg
|
|
4386
4419
|
class="emotion-5"
|
|
4387
|
-
height="
|
|
4420
|
+
height="48px"
|
|
4388
4421
|
viewBox="0 0 244 40"
|
|
4389
4422
|
>
|
|
4390
4423
|
<title>
|
|
@@ -4392,15 +4425,17 @@ exports[`Article should render tile and sub title 1`] = `
|
|
|
4392
4425
|
</title>
|
|
4393
4426
|
<path
|
|
4394
4427
|
d="M61.846.936c3.35.413 4.944 4.005 4.92 8.746l.017-.013c-5.497 4.462-16.323 7.515-26.958 1.71l.011-.016c1.568.832 3.224 1.475 5.172 1.715 2.386.294 4.303-1.023 6.043-2.889l.124-.134.062-.068.123-.137.123-.138.122-.14.121-.142.061-.071.121-.144.12-.145.146-.178.073-.09.182-.226.181-.228.144-.184.144-.185.143-.185.215-.279 1.091-1.431.209-.271.209-.269.14-.178.14-.177.14-.175.141-.173.141-.172.113-.136.113-.135.114-.133.114-.132.057-.065.114-.13.057-.064.115-.127.173-.187.116-.123.175-.18.117-.118C58.328 1.663 59.933.7 61.846.936z"
|
|
4395
|
-
fill="
|
|
4428
|
+
fill="white"
|
|
4396
4429
|
/>
|
|
4397
4430
|
<path
|
|
4398
4431
|
d="M26.763 28.981l.011.013c-1.414-.671-2.883-1.176-4.519-1.378-1.738-.214-3.244.513-4.634 1.704l-.11.095-.163.146-.108.1-.108.101-.268.261-.106.107-.106.109-.106.11-.053.056-.105.112-.053.057-.125.136-.124.138-.124.139-.062.07-.123.142-.123.143-.122.145-.122.146-.061.073-.15.183-.075.092-.149.185-.075.093-.149.187-.149.188-.223.283-.296.38-.671.866-.222.285-.222.283-.148.188-.223.28-.149.185-.149.183-.149.182-.15.18-.117.139-.118.138-.118.136-.118.135-.119.133-.119.132-.119.13-.06.064-.12.127-.1.104-.1.103-.1.101-.151.15-.101.098-.102.096-.051.048-.102.094-.206.183-.103.089-.052.044-.104.086c-1.302 1.066-2.706 1.698-4.305 1.5-3.321-.41-4.98-3.93-5.064-8.601l-.097.09c6.351-5.963 17.155-6.757 26.506-2.264z"
|
|
4399
|
-
fill="
|
|
4432
|
+
fill="white"
|
|
4433
|
+
fill-opacity="0.4"
|
|
4400
4434
|
/>
|
|
4401
4435
|
<path
|
|
4402
4436
|
d="M42.216 35.925c-2.861-.398-5.212-1.275-7.302-2.318l-.189-.095-.188-.096-.186-.097-.231-.122-.229-.123-.182-.099-.226-.125-.224-.126-.178-.101-.177-.102-.264-.153-.349-.205-.278-.166-.276-.166-.411-.249-1.214-.738-.334-.201-.333-.199-2.669-1.45-.012-.013c-9.258-4.447-19.94-3.714-26.315 2.087l-.095.088C.156 20.101 8.779 2.598 25.068 4.608c2.854.352 5.141 1.176 7.14 2.181l.178.09.177.091.175.092.087.046.173.093.172.094.17.095.085.048.211.12.209.121.166.097.165.098.164.098.163.099.162.099.161.099.16.1.261.164.13.082.258.164.256.164 1.137.733.25.161.25.159.312.197.312.194a31.02 31.02 0 0 0 1.568.911l.199.106c10.506 5.694 21.166 2.775 26.7-1.604l.149-.12c-.055 10.998-8.815 28.185-24.55 26.243z"
|
|
4403
|
-
fill="
|
|
4437
|
+
fill="white"
|
|
4438
|
+
fill-opacity="0.701961"
|
|
4404
4439
|
/>
|
|
4405
4440
|
</svg>
|
|
4406
4441
|
</div>
|
|
@@ -33,15 +33,17 @@ const NewsKitLogoFull = React.forwardRef<HTMLDivElement, NewsKitLogoProps>(
|
|
|
33
33
|
/>
|
|
34
34
|
<path
|
|
35
35
|
d="M61.846.936c3.35.413 4.944 4.005 4.92 8.746l.017-.013c-5.497 4.462-16.323 7.515-26.958 1.71l.011-.016c1.568.832 3.224 1.475 5.172 1.715 2.386.294 4.303-1.023 6.043-2.889l.124-.134.062-.068.123-.137.123-.138.122-.14.121-.142.061-.071.121-.144.12-.145.146-.178.073-.09.182-.226.181-.228.144-.184.144-.185.143-.185.215-.279 1.091-1.431.209-.271.209-.269.14-.178.14-.177.14-.175.141-.173.141-.172.113-.136.113-.135.114-.133.114-.132.057-.065.114-.13.057-.064.115-.127.173-.187.116-.123.175-.18.117-.118C58.328 1.663 59.933.7 61.846.936z"
|
|
36
|
-
fill="
|
|
36
|
+
fill="white"
|
|
37
37
|
/>
|
|
38
38
|
<path
|
|
39
39
|
d="M26.763 28.981l.011.013c-1.414-.671-2.883-1.176-4.519-1.378-1.738-.214-3.244.513-4.634 1.704l-.11.095-.163.146-.108.1-.108.101-.268.261-.106.107-.106.109-.106.11-.053.056-.105.112-.053.057-.125.136-.124.138-.124.139-.062.07-.123.142-.123.143-.122.145-.122.146-.061.073-.15.183-.075.092-.149.185-.075.093-.149.187-.149.188-.223.283-.296.38-.671.866-.222.285-.222.283-.148.188-.223.28-.149.185-.149.183-.149.182-.15.18-.117.139-.118.138-.118.136-.118.135-.119.133-.119.132-.119.13-.06.064-.12.127-.1.104-.1.103-.1.101-.151.15-.101.098-.102.096-.051.048-.102.094-.206.183-.103.089-.052.044-.104.086c-1.302 1.066-2.706 1.698-4.305 1.5-3.321-.41-4.98-3.93-5.064-8.601l-.097.09c6.351-5.963 17.155-6.757 26.506-2.264z"
|
|
40
|
-
fill="
|
|
40
|
+
fill="white"
|
|
41
|
+
fillOpacity="0.4"
|
|
41
42
|
/>
|
|
42
43
|
<path
|
|
43
44
|
d="M42.216 35.925c-2.861-.398-5.212-1.275-7.302-2.318l-.189-.095-.188-.096-.186-.097-.231-.122-.229-.123-.182-.099-.226-.125-.224-.126-.178-.101-.177-.102-.264-.153-.349-.205-.278-.166-.276-.166-.411-.249-1.214-.738-.334-.201-.333-.199-2.669-1.45-.012-.013c-9.258-4.447-19.94-3.714-26.315 2.087l-.095.088C.156 20.101 8.779 2.598 25.068 4.608c2.854.352 5.141 1.176 7.14 2.181l.178.09.177.091.175.092.087.046.173.093.172.094.17.095.085.048.211.12.209.121.166.097.165.098.164.098.163.099.162.099.161.099.16.1.261.164.13.082.258.164.256.164 1.137.733.25.161.25.159.312.197.312.194a31.02 31.02 0 0 0 1.568.911l.199.106c10.506 5.694 21.166 2.775 26.7-1.604l.149-.12c-.055 10.998-8.815 28.185-24.55 26.243z"
|
|
44
|
-
fill="
|
|
45
|
+
fill="white"
|
|
46
|
+
fillOpacity="0.701961"
|
|
45
47
|
/>
|
|
46
48
|
</LogoSvg>
|
|
47
49
|
)
|
|
@@ -25,19 +25,21 @@ const LogoSvg = styled.svg<StyledLogoPorps>`
|
|
|
25
25
|
|
|
26
26
|
const NewsKitLogoShort = React.forwardRef<HTMLDivElement, NewsKitLogoProps>(
|
|
27
27
|
({ color, ...props }, ref) => (
|
|
28
|
-
<LogoSvg viewBox="0 0 244 40" height="
|
|
28
|
+
<LogoSvg viewBox="0 0 244 40" height="48px" $color={color} {...props}>
|
|
29
29
|
<title>NewsKit Logo</title>
|
|
30
30
|
<path
|
|
31
31
|
d="M61.846.936c3.35.413 4.944 4.005 4.92 8.746l.017-.013c-5.497 4.462-16.323 7.515-26.958 1.71l.011-.016c1.568.832 3.224 1.475 5.172 1.715 2.386.294 4.303-1.023 6.043-2.889l.124-.134.062-.068.123-.137.123-.138.122-.14.121-.142.061-.071.121-.144.12-.145.146-.178.073-.09.182-.226.181-.228.144-.184.144-.185.143-.185.215-.279 1.091-1.431.209-.271.209-.269.14-.178.14-.177.14-.175.141-.173.141-.172.113-.136.113-.135.114-.133.114-.132.057-.065.114-.13.057-.064.115-.127.173-.187.116-.123.175-.18.117-.118C58.328 1.663 59.933.7 61.846.936z"
|
|
32
|
-
fill="
|
|
32
|
+
fill="white"
|
|
33
33
|
/>
|
|
34
34
|
<path
|
|
35
35
|
d="M26.763 28.981l.011.013c-1.414-.671-2.883-1.176-4.519-1.378-1.738-.214-3.244.513-4.634 1.704l-.11.095-.163.146-.108.1-.108.101-.268.261-.106.107-.106.109-.106.11-.053.056-.105.112-.053.057-.125.136-.124.138-.124.139-.062.07-.123.142-.123.143-.122.145-.122.146-.061.073-.15.183-.075.092-.149.185-.075.093-.149.187-.149.188-.223.283-.296.38-.671.866-.222.285-.222.283-.148.188-.223.28-.149.185-.149.183-.149.182-.15.18-.117.139-.118.138-.118.136-.118.135-.119.133-.119.132-.119.13-.06.064-.12.127-.1.104-.1.103-.1.101-.151.15-.101.098-.102.096-.051.048-.102.094-.206.183-.103.089-.052.044-.104.086c-1.302 1.066-2.706 1.698-4.305 1.5-3.321-.41-4.98-3.93-5.064-8.601l-.097.09c6.351-5.963 17.155-6.757 26.506-2.264z"
|
|
36
|
-
fill="
|
|
36
|
+
fill="white"
|
|
37
|
+
fillOpacity="0.4"
|
|
37
38
|
/>
|
|
38
39
|
<path
|
|
39
40
|
d="M42.216 35.925c-2.861-.398-5.212-1.275-7.302-2.318l-.189-.095-.188-.096-.186-.097-.231-.122-.229-.123-.182-.099-.226-.125-.224-.126-.178-.101-.177-.102-.264-.153-.349-.205-.278-.166-.276-.166-.411-.249-1.214-.738-.334-.201-.333-.199-2.669-1.45-.012-.013c-9.258-4.447-19.94-3.714-26.315 2.087l-.095.088C.156 20.101 8.779 2.598 25.068 4.608c2.854.352 5.141 1.176 7.14 2.181l.178.09.177.091.175.092.087.046.173.093.172.094.17.095.085.048.211.12.209.121.166.097.165.098.164.098.163.099.162.099.161.099.16.1.261.164.13.082.258.164.256.164 1.137.733.25.161.25.159.312.197.312.194a31.02 31.02 0 0 0 1.568.911l.199.106c10.506 5.694 21.166 2.775 26.7-1.604l.149-.12c-.055 10.998-8.815 28.185-24.55 26.243z"
|
|
40
|
-
fill="
|
|
41
|
+
fill="white"
|
|
42
|
+
fillOpacity="0.701961"
|
|
41
43
|
/>
|
|
42
44
|
</LogoSvg>
|
|
43
45
|
)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { NextLink } from '@newskit-render/shared-components'
|
|
3
|
+
import { Divider, TextBlock, Block, Visible, styled } from 'newskit'
|
|
4
|
+
import { IconNavLinkProps } from './types'
|
|
5
|
+
|
|
6
|
+
const StylesVerticalVisible = styled(Visible)`
|
|
7
|
+
height: 100%;
|
|
8
|
+
`
|
|
9
|
+
|
|
10
|
+
const StylesHorizontalVisible = styled(Visible)`
|
|
11
|
+
width: 100%;
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
const IconBlock = styled(Block)<{ top?: string }>`
|
|
15
|
+
position: relative;
|
|
16
|
+
top: ${({ top }) => top || '3'}px;
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
const IconNavLink: React.FC<IconNavLinkProps> = ({
|
|
20
|
+
icon,
|
|
21
|
+
href,
|
|
22
|
+
text,
|
|
23
|
+
showVerticalDivider = { md: true, lg: true, xl: true },
|
|
24
|
+
showHorizontalDivider = { xs: true, sm: true },
|
|
25
|
+
spaceInline,
|
|
26
|
+
typographyPreset,
|
|
27
|
+
stylePreset,
|
|
28
|
+
iconTop,
|
|
29
|
+
}) => (
|
|
30
|
+
<>
|
|
31
|
+
{showVerticalDivider && (
|
|
32
|
+
<StylesVerticalVisible {...showVerticalDivider}>
|
|
33
|
+
<Divider vertical />
|
|
34
|
+
</StylesVerticalVisible>
|
|
35
|
+
)}
|
|
36
|
+
<Block spaceInline={spaceInline} />
|
|
37
|
+
<Block as="span">
|
|
38
|
+
{showHorizontalDivider && (
|
|
39
|
+
<>
|
|
40
|
+
<StylesHorizontalVisible {...showHorizontalDivider}>
|
|
41
|
+
<Divider />
|
|
42
|
+
<Block
|
|
43
|
+
data-testid="myBlock"
|
|
44
|
+
spaceStack={{
|
|
45
|
+
xs: 'space040',
|
|
46
|
+
md: 'space000',
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
</StylesHorizontalVisible>
|
|
50
|
+
</>
|
|
51
|
+
)}
|
|
52
|
+
<NextLink
|
|
53
|
+
type="standalone"
|
|
54
|
+
overrides={{
|
|
55
|
+
typographyPreset,
|
|
56
|
+
stylePreset,
|
|
57
|
+
}}
|
|
58
|
+
href={href}
|
|
59
|
+
>
|
|
60
|
+
<IconBlock top={iconTop}>{icon}</IconBlock>
|
|
61
|
+
<TextBlock as="span" typographyPreset={typographyPreset}>
|
|
62
|
+
{text}
|
|
63
|
+
</TextBlock>
|
|
64
|
+
</NextLink>
|
|
65
|
+
<Block spaceInline={spaceInline} />
|
|
66
|
+
</Block>
|
|
67
|
+
</>
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
export default IconNavLink
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import IconNavLink from '../IconNavLink'
|
|
3
|
+
import { IconAccount } from '../../icons/IconAccount'
|
|
4
|
+
import { renderWithTheme } from '../../../../helpers/test-utils'
|
|
5
|
+
|
|
6
|
+
describe('IconNavLink', () => {
|
|
7
|
+
test('should render with devider', () => {
|
|
8
|
+
const { getByTestId, getByText, getAllByTestId } = renderWithTheme(
|
|
9
|
+
IconNavLink,
|
|
10
|
+
{
|
|
11
|
+
icon: <IconAccount data-testid="test-icon" />,
|
|
12
|
+
href: '/account',
|
|
13
|
+
text: 'Account',
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
expect(getAllByTestId('divider')[0]).toBeInTheDocument()
|
|
17
|
+
expect(getByTestId('test-icon')).toBeInTheDocument()
|
|
18
|
+
expect(getByText('Account')).toBeInTheDocument()
|
|
19
|
+
expect(getByText('Account').closest('a')).toHaveAttribute(
|
|
20
|
+
'href',
|
|
21
|
+
'/account'
|
|
22
|
+
)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('should render without divider', () => {
|
|
26
|
+
const { queryByTestId } = renderWithTheme(IconNavLink, {
|
|
27
|
+
icon: <IconAccount data-testid="test-icon" />,
|
|
28
|
+
href: '/account',
|
|
29
|
+
text: 'Account',
|
|
30
|
+
showVerticalDivider: false,
|
|
31
|
+
showHorizontalDivider: false,
|
|
32
|
+
})
|
|
33
|
+
expect(queryByTestId('divider')).not.toBeInTheDocument()
|
|
34
|
+
})
|
|
35
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactElement } from 'react'
|
|
2
|
+
import { NewsKitIcon, MQ } from 'newskit'
|
|
3
|
+
|
|
4
|
+
type ShowDivider =
|
|
5
|
+
| {
|
|
6
|
+
xs?: boolean
|
|
7
|
+
sm?: boolean
|
|
8
|
+
md?: boolean
|
|
9
|
+
lg?: boolean
|
|
10
|
+
xl?: boolean
|
|
11
|
+
}
|
|
12
|
+
| false
|
|
13
|
+
|
|
14
|
+
export interface IconNavLinkProps {
|
|
15
|
+
icon: ReactElement<NewsKitIcon>
|
|
16
|
+
href: string
|
|
17
|
+
text: string
|
|
18
|
+
showVerticalDivider?: ShowDivider
|
|
19
|
+
showHorizontalDivider?: ShowDivider
|
|
20
|
+
spaceInline?: MQ<string>
|
|
21
|
+
typographyPreset?: MQ<string>
|
|
22
|
+
stylePreset?: MQ<string>
|
|
23
|
+
iconTop?: string
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { customToNewsKitIcon, Svg } from 'newskit'
|
|
3
|
+
|
|
4
|
+
export const IconAccount = customToNewsKitIcon('IconAccount', (props) => (
|
|
5
|
+
<Svg {...props} height="24px" width="24px" viewBox="0 0 24 24">
|
|
6
|
+
<path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM7.07 18.28C7.5 17.38 10.12 16.5 12 16.5C13.88 16.5 16.51 17.38 16.93 18.28C15.57 19.36 13.86 20 12 20C10.14 20 8.43 19.36 7.07 18.28ZM12 14.5C13.46 14.5 16.93 15.09 18.36 16.83C19.38 15.49 20 13.82 20 12C20 7.59 16.41 4 12 4C7.59 4 4 7.59 4 12C4 13.82 4.62 15.49 5.64 16.83C7.07 15.09 10.54 14.5 12 14.5ZM12 6C10.06 6 8.5 7.56 8.5 9.5C8.5 11.44 10.06 13 12 13C13.94 13 15.5 11.44 15.5 9.5C15.5 7.56 13.94 6 12 6ZM10.5 9.5C10.5 10.33 11.17 11 12 11C12.83 11 13.5 10.33 13.5 9.5C13.5 8.67 12.83 8 12 8C11.17 8 10.5 8.67 10.5 9.5Z"
|
|
10
|
+
fill="#FFFFFF"
|
|
11
|
+
/>
|
|
12
|
+
</Svg>
|
|
13
|
+
))
|