@ndla/ui 56.0.15-alpha.0 → 56.0.16-alpha.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/dist/panda.buildinfo.json +18 -20
- package/dist/styles.css +62 -67
- package/es/Article/Article.js +22 -94
- package/es/Article/index.js +1 -1
- package/es/CampaignBlock/CampaignBlock.js +33 -5
- package/es/index.js +1 -1
- package/es/locale/messages-en.js +2 -2
- package/es/locale/messages-nb.js +2 -2
- package/es/locale/messages-nn.js +2 -2
- package/es/locale/messages-se.js +2 -2
- package/es/locale/messages-sma.js +2 -2
- package/es/styles.css +62 -67
- package/lib/Article/Article.d.ts +3 -18
- package/lib/Article/Article.js +22 -94
- package/lib/Article/index.d.ts +1 -1
- package/lib/Article/index.js +0 -12
- package/lib/CampaignBlock/CampaignBlock.js +33 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -12
- package/lib/locale/messages-en.js +2 -2
- package/lib/locale/messages-nb.js +2 -2
- package/lib/locale/messages-nn.js +2 -2
- package/lib/locale/messages-se.js +2 -2
- package/lib/locale/messages-sma.js +2 -2
- package/lib/styles.css +62 -67
- package/package.json +7 -7
- package/src/Article/Article.tsx +22 -107
- package/src/Article/index.ts +0 -2
- package/src/CampaignBlock/CampaignBlock.tsx +35 -4
- package/src/index.ts +0 -2
- package/src/locale/messages-en.ts +2 -2
- package/src/locale/messages-nb.ts +2 -2
- package/src/locale/messages-nn.ts +2 -2
- package/src/locale/messages-se.ts +2 -2
- package/src/locale/messages-sma.ts +2 -2
|
@@ -1075,9 +1075,9 @@ const messages = {
|
|
|
1075
1075
|
},
|
|
1076
1076
|
fetchMore: "Hent flere svar",
|
|
1077
1077
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1078
|
-
upvote: "
|
|
1078
|
+
upvote: "Liker",
|
|
1079
1079
|
numberOfUpvotes: "{{ count }} personer har stemt opp denne.",
|
|
1080
|
-
removeUpvote: "
|
|
1080
|
+
removeUpvote: "Slutt å like",
|
|
1081
1081
|
reply: "Skriv et svar til {{ name }}"
|
|
1082
1082
|
},
|
|
1083
1083
|
flag: {
|
|
@@ -1075,9 +1075,9 @@ const messages = {
|
|
|
1075
1075
|
},
|
|
1076
1076
|
fetchMore: "Hent fleire svar",
|
|
1077
1077
|
deleted: "Dette innlegget er sletta av forfatteren.",
|
|
1078
|
-
upvote: "
|
|
1078
|
+
upvote: "Liker",
|
|
1079
1079
|
numberOfUpvotes: "{{ count }} personar har stemt opp denne.",
|
|
1080
|
-
removeUpvote: "
|
|
1080
|
+
removeUpvote: "Slutt å like",
|
|
1081
1081
|
reply: "Skriv eit svar til {{ name }}"
|
|
1082
1082
|
},
|
|
1083
1083
|
flag: {
|
|
@@ -1075,9 +1075,9 @@ const messages = {
|
|
|
1075
1075
|
},
|
|
1076
1076
|
fetchMore: "Hent flere svar",
|
|
1077
1077
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1078
|
-
upvote: "
|
|
1078
|
+
upvote: "Liker",
|
|
1079
1079
|
numberOfUpvotes: "{{ count }} personer har stemt opp denne.",
|
|
1080
|
-
removeUpvote: "
|
|
1080
|
+
removeUpvote: "Slutt å like",
|
|
1081
1081
|
reply: "Skriv et svar til {{ name }}"
|
|
1082
1082
|
},
|
|
1083
1083
|
flag: {
|
|
@@ -1075,9 +1075,9 @@ const messages = {
|
|
|
1075
1075
|
},
|
|
1076
1076
|
fetchMore: "Hent flere svar",
|
|
1077
1077
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1078
|
-
upvote: "
|
|
1078
|
+
upvote: "Liker",
|
|
1079
1079
|
numberOfUpvotes: "{{ count }} personer har stemt opp denne.",
|
|
1080
|
-
removeUpvote: "
|
|
1080
|
+
removeUpvote: "Slutt å like",
|
|
1081
1081
|
reply: "Skriv et svar til {{ name }}"
|
|
1082
1082
|
},
|
|
1083
1083
|
flag: {
|
package/lib/styles.css
CHANGED
|
@@ -85,34 +85,26 @@
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.w_100\% {
|
|
93
|
-
width: 100%;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.pbs_xsmall {
|
|
97
|
-
padding-block-start: var(--spacing-xsmall);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.pbe_xsmall {
|
|
101
|
-
padding-block-end: var(--spacing-xsmall);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.bg_surface\.default {
|
|
105
|
-
background: var(--colors-surface-default);
|
|
88
|
+
.bg_background\.default {
|
|
89
|
+
background: var(--colors-background-default);
|
|
106
90
|
}
|
|
107
91
|
|
|
108
92
|
.d_flex {
|
|
109
93
|
display: flex;
|
|
110
94
|
}
|
|
111
95
|
|
|
96
|
+
.gap_xxlarge {
|
|
97
|
+
gap: var(--spacing-xxlarge);
|
|
98
|
+
}
|
|
99
|
+
|
|
112
100
|
.c_text\.default {
|
|
113
101
|
color: var(--colors-text-default);
|
|
114
102
|
}
|
|
115
103
|
|
|
104
|
+
.w_100\% {
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
116
108
|
.ov-wrap_break-word {
|
|
117
109
|
overflow-wrap: break-word;
|
|
118
110
|
}
|
|
@@ -121,26 +113,22 @@
|
|
|
121
113
|
position: relative;
|
|
122
114
|
}
|
|
123
115
|
|
|
124
|
-
.gap_xsmall {
|
|
125
|
-
gap: var(--spacing-xsmall);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.pos_absolute {
|
|
129
|
-
position: absolute;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
116
|
.gap_medium {
|
|
133
117
|
gap: var(--spacing-medium);
|
|
134
118
|
}
|
|
135
119
|
|
|
136
|
-
.
|
|
137
|
-
|
|
120
|
+
.pbs_xxlarge {
|
|
121
|
+
padding-block-start: var(--spacing-xxlarge);
|
|
138
122
|
}
|
|
139
123
|
|
|
140
124
|
.mbs_medium {
|
|
141
125
|
margin-block-start: var(--spacing-medium);
|
|
142
126
|
}
|
|
143
127
|
|
|
128
|
+
.pbs_xsmall {
|
|
129
|
+
padding-block-start: var(--spacing-xsmall);
|
|
130
|
+
}
|
|
131
|
+
|
|
144
132
|
.bd-t_1px_solid {
|
|
145
133
|
border-top: 1px solid;
|
|
146
134
|
}
|
|
@@ -153,8 +141,8 @@
|
|
|
153
141
|
padding-block: var(--spacing-xsmall);
|
|
154
142
|
}
|
|
155
143
|
|
|
156
|
-
.
|
|
157
|
-
|
|
144
|
+
.gap_xsmall {
|
|
145
|
+
gap: var(--spacing-xsmall);
|
|
158
146
|
}
|
|
159
147
|
|
|
160
148
|
.li-s_none {
|
|
@@ -218,10 +206,6 @@
|
|
|
218
206
|
border-bottom-right-radius: var(--radii-xsmall);
|
|
219
207
|
}
|
|
220
208
|
|
|
221
|
-
.bg_background\.default {
|
|
222
|
-
background: var(--colors-background-default);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
209
|
.px_medium {
|
|
226
210
|
padding-inline: var(--spacing-medium);
|
|
227
211
|
}
|
|
@@ -374,6 +358,10 @@
|
|
|
374
358
|
padding: var(--spacing-medium);
|
|
375
359
|
}
|
|
376
360
|
|
|
361
|
+
.bg_surface\.default {
|
|
362
|
+
background: var(--colors-surface-default);
|
|
363
|
+
}
|
|
364
|
+
|
|
377
365
|
.z_base {
|
|
378
366
|
z-index: var(--z-index-base);
|
|
379
367
|
}
|
|
@@ -426,6 +414,10 @@
|
|
|
426
414
|
border: 2px solid;
|
|
427
415
|
}
|
|
428
416
|
|
|
417
|
+
.pos_absolute {
|
|
418
|
+
position: absolute;
|
|
419
|
+
}
|
|
420
|
+
|
|
429
421
|
.op_0 {
|
|
430
422
|
opacity: 0;
|
|
431
423
|
}
|
|
@@ -635,14 +627,6 @@
|
|
|
635
627
|
align-items: flex-start;
|
|
636
628
|
}
|
|
637
629
|
|
|
638
|
-
.right_8\% {
|
|
639
|
-
right: 8%;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
.top_xsmall {
|
|
643
|
-
top: var(--spacing-xsmall);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
630
|
.bd-c_stroke\.subtle {
|
|
647
631
|
border-color: var(--colors-stroke-subtle);
|
|
648
632
|
}
|
|
@@ -694,6 +678,10 @@
|
|
|
694
678
|
align-items: flex-end;
|
|
695
679
|
}
|
|
696
680
|
|
|
681
|
+
.fw_bold {
|
|
682
|
+
font-weight: var(--font-weights-bold);
|
|
683
|
+
}
|
|
684
|
+
|
|
697
685
|
.as_center {
|
|
698
686
|
align-self: center;
|
|
699
687
|
}
|
|
@@ -734,10 +722,6 @@
|
|
|
734
722
|
top: calc(var(--spacing-4xsmall) * -1);
|
|
735
723
|
}
|
|
736
724
|
|
|
737
|
-
.fw_bold {
|
|
738
|
-
font-weight: var(--font-weights-bold);
|
|
739
|
-
}
|
|
740
|
-
|
|
741
725
|
.bg-c_surface\.disabled {
|
|
742
726
|
background-color: var(--colors-surface-disabled);
|
|
743
727
|
}
|
|
@@ -773,6 +757,10 @@
|
|
|
773
757
|
transition-timing-function: ease-out;
|
|
774
758
|
}
|
|
775
759
|
|
|
760
|
+
.top_xsmall {
|
|
761
|
+
top: var(--spacing-xsmall);
|
|
762
|
+
}
|
|
763
|
+
|
|
776
764
|
.right_xsmall {
|
|
777
765
|
right: var(--spacing-xsmall);
|
|
778
766
|
}
|
|
@@ -908,6 +896,10 @@
|
|
|
908
896
|
overflow-wrap: anywhere;
|
|
909
897
|
}
|
|
910
898
|
|
|
899
|
+
.\[\&_\>_\:is\(\:last-child\)\]\:pbe_5xlarge > :is(:last-child) {
|
|
900
|
+
padding-block-end: var(--spacing-5xlarge);
|
|
901
|
+
}
|
|
902
|
+
|
|
911
903
|
.\[\&\[data-align\=\"center\"\]\]\:ta_center[data-align="center"] {
|
|
912
904
|
text-align: center;
|
|
913
905
|
}
|
|
@@ -1456,6 +1448,9 @@
|
|
|
1456
1448
|
}
|
|
1457
1449
|
|
|
1458
1450
|
@media screen and (min-width: 29.75rem) {
|
|
1451
|
+
.mobileWide\:h_340px {
|
|
1452
|
+
height: 340px;
|
|
1453
|
+
}
|
|
1459
1454
|
.mobileWide\:d_none {
|
|
1460
1455
|
display: none;
|
|
1461
1456
|
}
|
|
@@ -1468,12 +1463,6 @@
|
|
|
1468
1463
|
}
|
|
1469
1464
|
|
|
1470
1465
|
@media screen and (min-width: 37.5625rem) {
|
|
1471
|
-
.tablet\:pbs_medium {
|
|
1472
|
-
padding-block-start: var(--spacing-medium);
|
|
1473
|
-
}
|
|
1474
|
-
.tablet\:pbe_medium {
|
|
1475
|
-
padding-block-end: var(--spacing-medium);
|
|
1476
|
-
}
|
|
1477
1466
|
.tablet\:px_medium {
|
|
1478
1467
|
padding-inline: var(--spacing-medium);
|
|
1479
1468
|
}
|
|
@@ -1488,9 +1477,6 @@
|
|
|
1488
1477
|
}
|
|
1489
1478
|
.tablet\:w_83\.333\% {
|
|
1490
1479
|
width: 83.333%;
|
|
1491
|
-
}
|
|
1492
|
-
.tablet\:top_medium {
|
|
1493
|
-
top: var(--spacing-medium);
|
|
1494
1480
|
}
|
|
1495
1481
|
.tablet\:ai_unset {
|
|
1496
1482
|
align-items: unset;
|
|
@@ -1557,6 +1543,27 @@
|
|
|
1557
1543
|
}
|
|
1558
1544
|
.tabletWide\:max-w_532px {
|
|
1559
1545
|
max-width: 532px;
|
|
1546
|
+
}
|
|
1547
|
+
.tabletWide\:w_auto {
|
|
1548
|
+
width: auto;
|
|
1549
|
+
}
|
|
1550
|
+
.tabletWide\:d_block {
|
|
1551
|
+
display: block;
|
|
1552
|
+
}
|
|
1553
|
+
.tabletWide\:ov_hidden {
|
|
1554
|
+
overflow: hidden;
|
|
1555
|
+
}
|
|
1556
|
+
.tabletWide\:pos_relative {
|
|
1557
|
+
position: relative;
|
|
1558
|
+
}
|
|
1559
|
+
.tabletWide\:lc_4 {
|
|
1560
|
+
overflow: hidden;
|
|
1561
|
+
display: -webkit-box;
|
|
1562
|
+
-webkit-line-clamp: 4;
|
|
1563
|
+
-webkit-box-orient: vertical;
|
|
1564
|
+
}
|
|
1565
|
+
.tabletWide\:box-orient_vertical {
|
|
1566
|
+
box-orient: vertical;
|
|
1560
1567
|
}
|
|
1561
1568
|
.tabletWide\:flex-d_row {
|
|
1562
1569
|
flex-direction: row;
|
|
@@ -1567,23 +1574,11 @@
|
|
|
1567
1574
|
}
|
|
1568
1575
|
|
|
1569
1576
|
@media screen and (min-width: 61.3125rem) {
|
|
1570
|
-
.desktop\:pbs_xxlarge {
|
|
1571
|
-
padding-block-start: var(--spacing-xxlarge);
|
|
1572
|
-
}
|
|
1573
|
-
.desktop\:pbe_xxlarge {
|
|
1574
|
-
padding-block-end: var(--spacing-xxlarge);
|
|
1575
|
-
}
|
|
1576
1577
|
.desktop\:w_260px {
|
|
1577
1578
|
width: 260px;
|
|
1578
1579
|
}
|
|
1579
1580
|
.desktop\:h_260px {
|
|
1580
1581
|
height: 260px;
|
|
1581
|
-
}
|
|
1582
|
-
.desktop\:h_340px {
|
|
1583
|
-
height: 340px;
|
|
1584
|
-
}
|
|
1585
|
-
.desktop\:top_xxlarge {
|
|
1586
|
-
top: var(--spacing-xxlarge);
|
|
1587
1582
|
}
|
|
1588
1583
|
.desktop\:grid-tc_repeat\(3\,_minmax\(0\,_1fr\)\) {
|
|
1589
1584
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.16-alpha.0",
|
|
4
4
|
"description": "UI component library for NDLA",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ndla/core": "^5.0.2",
|
|
37
|
-
"@ndla/icons": "^8.0.
|
|
37
|
+
"@ndla/icons": "^8.0.11-alpha.0",
|
|
38
38
|
"@ndla/licenses": "^8.0.1-alpha.0",
|
|
39
|
-
"@ndla/primitives": "^1.0.
|
|
40
|
-
"@ndla/safelink": "^7.0.
|
|
41
|
-
"@ndla/styled-system": "^0.0.
|
|
39
|
+
"@ndla/primitives": "^1.0.15-alpha.0",
|
|
40
|
+
"@ndla/safelink": "^7.0.15-alpha.0",
|
|
41
|
+
"@ndla/styled-system": "^0.0.13",
|
|
42
42
|
"@ndla/util": "^4.1.0",
|
|
43
43
|
"html-react-parser": "^5.1.8",
|
|
44
44
|
"i18next-browser-languagedetector": "^7.1.0"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"react-router-dom": "> 6.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@ndla/preset-panda": "^0.0.
|
|
56
|
+
"@ndla/preset-panda": "^0.0.21",
|
|
57
57
|
"@ndla/types-backend": "^0.2.86",
|
|
58
58
|
"@ndla/types-embed": "^5.0.1-alpha.0",
|
|
59
59
|
"@pandacss/dev": "^0.44.0",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "b37f00c4b3c340890aa9729d74439fa84e2d2eed"
|
|
70
70
|
}
|
package/src/Article/Article.tsx
CHANGED
|
@@ -10,78 +10,16 @@ import { ComponentPropsWithRef, ReactNode, forwardRef } from "react";
|
|
|
10
10
|
import { ark, type HTMLArkProps } from "@ark-ui/react";
|
|
11
11
|
import { Heading, Text } from "@ndla/primitives";
|
|
12
12
|
import { cx } from "@ndla/styled-system/css";
|
|
13
|
-
import { styled } from "@ndla/styled-system/jsx";
|
|
14
|
-
import { JsxStyleProps
|
|
13
|
+
import { Stack, styled } from "@ndla/styled-system/jsx";
|
|
14
|
+
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
15
15
|
import { ArticleByline } from "./ArticleByline";
|
|
16
16
|
import { ContentTypeBadgeNew } from "..";
|
|
17
17
|
import { ContentType } from "../ContentTypeBadge/ContentTypeBadgeNew";
|
|
18
18
|
import { Article as ArticleType } from "../types";
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
paddingInline: "8%",
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const paddingBlockEnd: SystemStyleObject = {
|
|
25
|
-
paddingBlockEnd: "xsmall",
|
|
26
|
-
tablet: {
|
|
27
|
-
paddingBlockEnd: "medium",
|
|
28
|
-
},
|
|
29
|
-
desktop: {
|
|
30
|
-
paddingBlockEnd: "xxlarge",
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const paddingBlockStart: SystemStyleObject = {
|
|
35
|
-
paddingBlockStart: "xsmall",
|
|
36
|
-
tablet: {
|
|
37
|
-
paddingBlockStart: "medium",
|
|
38
|
-
},
|
|
39
|
-
desktop: {
|
|
40
|
-
paddingBlockStart: "xxlarge",
|
|
41
|
-
},
|
|
42
|
-
};
|
|
20
|
+
const StyledArticleContent = styled(ark.section, {}, { baseComponent: true });
|
|
43
21
|
|
|
44
|
-
export const
|
|
45
|
-
ark.div,
|
|
46
|
-
{
|
|
47
|
-
base: {
|
|
48
|
-
...articlePadding,
|
|
49
|
-
width: "100%",
|
|
50
|
-
},
|
|
51
|
-
variants: {
|
|
52
|
-
padStart: {
|
|
53
|
-
true: paddingBlockStart,
|
|
54
|
-
},
|
|
55
|
-
padEnd: {
|
|
56
|
-
true: paddingBlockEnd,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
{ baseComponent: true },
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
const StyledArticleContent = styled(
|
|
64
|
-
ark.section,
|
|
65
|
-
{
|
|
66
|
-
base: {
|
|
67
|
-
background: "surface.default",
|
|
68
|
-
},
|
|
69
|
-
variants: {
|
|
70
|
-
padded: {
|
|
71
|
-
true: {
|
|
72
|
-
...articlePadding,
|
|
73
|
-
...paddingBlockStart,
|
|
74
|
-
...paddingBlockEnd,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{ baseComponent: true },
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
type ArticleContentVariantProps = StyledVariantProps<typeof StyledArticleContent>;
|
|
83
|
-
|
|
84
|
-
export const ArticleContent = forwardRef<HTMLElement, HTMLArkProps<"div"> & JsxStyleProps & ArticleContentVariantProps>(
|
|
22
|
+
export const ArticleContent = forwardRef<HTMLElement, HTMLArkProps<"div"> & JsxStyleProps>(
|
|
85
23
|
({ className, ...props }, ref) => (
|
|
86
24
|
<StyledArticleContent className={cx("ndla-article", className)} {...props} ref={ref} />
|
|
87
25
|
),
|
|
@@ -91,8 +29,10 @@ const StyledArticleWrapper = styled(
|
|
|
91
29
|
ark.article,
|
|
92
30
|
{
|
|
93
31
|
base: {
|
|
32
|
+
background: "background.default",
|
|
94
33
|
display: "flex",
|
|
95
34
|
flexDirection: "column",
|
|
35
|
+
gap: "xxlarge",
|
|
96
36
|
color: "text.default",
|
|
97
37
|
alignItems: "center",
|
|
98
38
|
width: "100%",
|
|
@@ -123,7 +63,6 @@ export const ArticleHGroup = styled(
|
|
|
123
63
|
width: "100%",
|
|
124
64
|
flexDirection: "column",
|
|
125
65
|
alignItems: "flex-start",
|
|
126
|
-
gap: "xsmall",
|
|
127
66
|
"& h1": {
|
|
128
67
|
overflowWrap: "anywhere",
|
|
129
68
|
},
|
|
@@ -132,42 +71,16 @@ export const ArticleHGroup = styled(
|
|
|
132
71
|
{ baseComponent: true },
|
|
133
72
|
);
|
|
134
73
|
|
|
135
|
-
export const ArticleActionWrapper = styled(
|
|
136
|
-
ark.div,
|
|
137
|
-
{
|
|
138
|
-
base: {
|
|
139
|
-
position: "absolute",
|
|
140
|
-
right: "8%",
|
|
141
|
-
top: "xsmall",
|
|
142
|
-
tablet: {
|
|
143
|
-
top: "medium",
|
|
144
|
-
},
|
|
145
|
-
desktop: {
|
|
146
|
-
top: "xxlarge",
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
{ baseComponent: true },
|
|
151
|
-
);
|
|
152
|
-
|
|
153
74
|
export const ArticleHeader = styled(
|
|
154
75
|
ark.header,
|
|
155
76
|
{
|
|
156
77
|
base: {
|
|
157
78
|
display: "flex",
|
|
158
79
|
flexDirection: "column",
|
|
159
|
-
background: "surface.default",
|
|
160
80
|
gap: "medium",
|
|
161
81
|
alignItems: "flex-start",
|
|
162
82
|
width: "100%",
|
|
163
|
-
|
|
164
|
-
variants: {
|
|
165
|
-
padded: {
|
|
166
|
-
true: {
|
|
167
|
-
...articlePadding,
|
|
168
|
-
...paddingBlockStart,
|
|
169
|
-
},
|
|
170
|
-
},
|
|
83
|
+
paddingBlockStart: "xxlarge",
|
|
171
84
|
},
|
|
172
85
|
},
|
|
173
86
|
{ baseComponent: true },
|
|
@@ -179,22 +92,22 @@ export const ArticleFooter = styled(
|
|
|
179
92
|
base: {
|
|
180
93
|
display: "flex",
|
|
181
94
|
flexDirection: "column",
|
|
182
|
-
background: "surface.default",
|
|
183
95
|
gap: "xxlarge",
|
|
184
96
|
width: "100%",
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
padded: {
|
|
188
|
-
true: {
|
|
189
|
-
...articlePadding,
|
|
190
|
-
...paddingBlockEnd,
|
|
191
|
-
},
|
|
97
|
+
"& > :is(:last-child)": {
|
|
98
|
+
paddingBlockEnd: "5xlarge",
|
|
192
99
|
},
|
|
193
100
|
},
|
|
194
101
|
},
|
|
195
102
|
{ baseComponent: true },
|
|
196
103
|
);
|
|
197
104
|
|
|
105
|
+
const StyledStack = styled(Stack, {
|
|
106
|
+
base: {
|
|
107
|
+
width: "100%",
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
|
|
198
111
|
interface ArticleTitleProps {
|
|
199
112
|
heartButton?: ReactNode;
|
|
200
113
|
contentType?: ContentType;
|
|
@@ -215,10 +128,12 @@ export const ArticleTitle = ({
|
|
|
215
128
|
competenceGoals,
|
|
216
129
|
}: ArticleTitleProps) => {
|
|
217
130
|
return (
|
|
218
|
-
<ArticleHeader
|
|
131
|
+
<ArticleHeader>
|
|
219
132
|
<ArticleHGroup>
|
|
220
|
-
|
|
221
|
-
|
|
133
|
+
<StyledStack justify="space-between" align="center" direction="row" gap="small">
|
|
134
|
+
{!!contentType && <ContentTypeBadgeNew contentType={contentType} />}
|
|
135
|
+
{heartButton}
|
|
136
|
+
</StyledStack>
|
|
222
137
|
<Heading textStyle="heading.large" id={id} lang={lang}>
|
|
223
138
|
{title}
|
|
224
139
|
</Heading>
|
|
@@ -270,8 +185,8 @@ export const Article = ({
|
|
|
270
185
|
competenceGoals={competenceGoals}
|
|
271
186
|
lang={lang}
|
|
272
187
|
/>
|
|
273
|
-
<ArticleContent
|
|
274
|
-
<ArticleFooter
|
|
188
|
+
<ArticleContent>{content}</ArticleContent>
|
|
189
|
+
<ArticleFooter>
|
|
275
190
|
<ArticleByline
|
|
276
191
|
footnotes={footNotes}
|
|
277
192
|
authors={authors}
|
package/src/Article/index.ts
CHANGED
|
@@ -36,7 +36,9 @@ interface Props {
|
|
|
36
36
|
|
|
37
37
|
const Container = styled("div", {
|
|
38
38
|
base: {
|
|
39
|
+
width: "100%",
|
|
39
40
|
display: "flex",
|
|
41
|
+
gap: "medium",
|
|
40
42
|
flexDirection: "column",
|
|
41
43
|
border: "1px solid",
|
|
42
44
|
borderColor: "stroke.default",
|
|
@@ -59,17 +61,33 @@ const LinkText = styled(Text, {
|
|
|
59
61
|
_hover: {
|
|
60
62
|
textDecoration: "none",
|
|
61
63
|
},
|
|
64
|
+
paddingBlock: "xsmall",
|
|
65
|
+
fontWeight: "bold",
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const LinkHeader = styled(Text, {
|
|
70
|
+
base: {
|
|
71
|
+
display: "flex",
|
|
72
|
+
textDecoration: "underline",
|
|
73
|
+
_hover: {
|
|
74
|
+
textDecoration: "none",
|
|
75
|
+
},
|
|
62
76
|
},
|
|
63
77
|
});
|
|
78
|
+
|
|
64
79
|
const StyledImg = styled("img", {
|
|
65
80
|
base: {
|
|
66
81
|
alignSelf: "center",
|
|
67
82
|
objectFit: "cover",
|
|
68
83
|
width: "100%",
|
|
69
84
|
height: "215px",
|
|
70
|
-
|
|
85
|
+
mobileWide: {
|
|
71
86
|
height: "340px",
|
|
72
87
|
},
|
|
88
|
+
tabletWide: {
|
|
89
|
+
width: "auto",
|
|
90
|
+
},
|
|
73
91
|
},
|
|
74
92
|
});
|
|
75
93
|
|
|
@@ -79,13 +97,26 @@ const ContentWrapper = styled("div", {
|
|
|
79
97
|
position: "relative",
|
|
80
98
|
display: "flex",
|
|
81
99
|
flexDirection: "column",
|
|
82
|
-
gap: "
|
|
100
|
+
gap: "medium",
|
|
83
101
|
alignItems: "flex-start",
|
|
102
|
+
justifyContent: "center",
|
|
84
103
|
paddingBlock: "medium",
|
|
85
104
|
paddingInline: "medium",
|
|
86
105
|
},
|
|
87
106
|
});
|
|
88
107
|
|
|
108
|
+
const StyledText = styled(Text, {
|
|
109
|
+
base: {
|
|
110
|
+
tabletWide: {
|
|
111
|
+
display: "block",
|
|
112
|
+
overflow: "hidden",
|
|
113
|
+
position: "relative",
|
|
114
|
+
lineClamp: 4,
|
|
115
|
+
boxOrient: "vertical",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
|
|
89
120
|
interface MaybeLinkTextProps {
|
|
90
121
|
url?: string;
|
|
91
122
|
path?: string;
|
|
@@ -114,7 +145,7 @@ const CampaignBlock = ({
|
|
|
114
145
|
className,
|
|
115
146
|
}: Props) => {
|
|
116
147
|
const imageComponent = image && <StyledImg src={`${image.src}?width=455`} height={340} width={455} alt={image.alt} />;
|
|
117
|
-
const HeaderComponent = url?.url ?
|
|
148
|
+
const HeaderComponent = url?.url ? LinkHeader : Text;
|
|
118
149
|
return (
|
|
119
150
|
<Container className={className} data-embed-type="campaign-block">
|
|
120
151
|
{imageSide === "left" && imageComponent}
|
|
@@ -124,7 +155,7 @@ const CampaignBlock = ({
|
|
|
124
155
|
<InternalHeading>{parse(title)}</InternalHeading>
|
|
125
156
|
</HeaderComponent>
|
|
126
157
|
</MaybeLinkText>
|
|
127
|
-
<
|
|
158
|
+
<StyledText textStyle="body.xlarge">{parse(description)}</StyledText>
|
|
128
159
|
{!!url?.url && (
|
|
129
160
|
<MaybeLinkText url={url.url} path={path}>
|
|
130
161
|
<LinkText textStyle="body.medium">
|
package/src/index.ts
CHANGED
|
@@ -1086,9 +1086,9 @@ const messages = {
|
|
|
1086
1086
|
},
|
|
1087
1087
|
fetchMore: "Fetch more answers",
|
|
1088
1088
|
deleted: "This post has been deleted by the author.",
|
|
1089
|
-
upvote: "
|
|
1089
|
+
upvote: "Like",
|
|
1090
1090
|
numberOfUpvotes: "{{ count }} people have upvoted this.",
|
|
1091
|
-
removeUpvote: "
|
|
1091
|
+
removeUpvote: "Stop liking",
|
|
1092
1092
|
reply: "Write a reply to {{ name }}",
|
|
1093
1093
|
},
|
|
1094
1094
|
flag: {
|
|
@@ -1087,9 +1087,9 @@ const messages = {
|
|
|
1087
1087
|
},
|
|
1088
1088
|
fetchMore: "Hent flere svar",
|
|
1089
1089
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1090
|
-
upvote: "
|
|
1090
|
+
upvote: "Liker",
|
|
1091
1091
|
numberOfUpvotes: "{{ count }} personer har stemt opp denne.",
|
|
1092
|
-
removeUpvote: "
|
|
1092
|
+
removeUpvote: "Slutt å like",
|
|
1093
1093
|
reply: "Skriv et svar til {{ name }}",
|
|
1094
1094
|
},
|
|
1095
1095
|
flag: {
|