@ndla/ui 56.0.86-alpha.0 → 56.0.88-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 +14 -8
- package/dist/styles.css +50 -26
- package/es/Article/Article.js +17 -4
- package/es/Embed/ExternalEmbed.js +79 -3
- package/es/Embed/UuDisclaimerEmbed.js +46 -41
- package/es/locale/messages-en.js +5 -1
- package/es/locale/messages-nb.js +5 -1
- package/es/locale/messages-nn.js +5 -1
- package/es/locale/messages-se.js +5 -1
- package/es/locale/messages-sma.js +5 -1
- package/lib/Article/Article.d.ts +4 -2
- package/lib/Article/Article.js +17 -4
- package/lib/Embed/ExternalEmbed.js +77 -1
- package/lib/Embed/UuDisclaimerEmbed.d.ts +2 -1
- package/lib/Embed/UuDisclaimerEmbed.js +44 -39
- package/lib/locale/messages-en.d.ts +4 -0
- package/lib/locale/messages-en.js +5 -1
- package/lib/locale/messages-nb.d.ts +4 -0
- package/lib/locale/messages-nb.js +5 -1
- package/lib/locale/messages-nn.d.ts +4 -0
- package/lib/locale/messages-nn.js +5 -1
- package/lib/locale/messages-se.d.ts +4 -0
- package/lib/locale/messages-se.js +5 -1
- package/lib/locale/messages-sma.d.ts +4 -0
- package/lib/locale/messages-sma.js +5 -1
- package/package.json +4 -4
- package/src/Article/Article.tsx +18 -1
- package/src/Embed/ExternalEmbed.stories.tsx +11 -0
- package/src/Embed/ExternalEmbed.tsx +79 -3
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +35 -32
- package/src/Embed/UuDisclaimerEmbed.tsx +46 -43
- package/src/locale/messages-en.ts +2 -0
- package/src/locale/messages-nb.ts +2 -0
- package/src/locale/messages-nn.ts +2 -0
- package/src/locale/messages-se.ts +2 -0
- package/src/locale/messages-sma.ts +2 -0
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"gap]___[value:xxlarge",
|
|
23
23
|
"paddingBlockEnd]___[value:5xlarge]___[cond:& > :is(:last-child)",
|
|
24
24
|
"minHeight]___[value:xxlarge",
|
|
25
|
+
"gap]___[value:small",
|
|
26
|
+
"flexWrap]___[value:wrap",
|
|
25
27
|
"marginBlockStart]___[value:medium",
|
|
26
28
|
"paddingBlockStart]___[value:xsmall",
|
|
27
29
|
"borderTop]___[value:1px solid",
|
|
@@ -99,7 +101,6 @@
|
|
|
99
101
|
"height]___[value:surface.3xsmall",
|
|
100
102
|
"minWidth]___[value:small",
|
|
101
103
|
"paddingInline]___[value:small",
|
|
102
|
-
"flexWrap]___[value:wrap",
|
|
103
104
|
"alignItems]___[value:flex-start]___[cond:mobileDown",
|
|
104
105
|
"justifyContent]___[value:center]___[cond:mobileDown",
|
|
105
106
|
"flexDirection]___[value:column]___[cond:mobileDown",
|
|
@@ -218,6 +219,15 @@
|
|
|
218
219
|
"clear]___[value:both]___[cond:& + [data-embed-wrapper]",
|
|
219
220
|
"height]___[value:auto]___[cond:& iframe",
|
|
220
221
|
"width]___[value:100%]___[cond:& iframe",
|
|
222
|
+
"color]___[value:text.link",
|
|
223
|
+
"textDecoration]___[value:unset]___[cond:_hover",
|
|
224
|
+
"backgroundColor]___[value:surface.brand.2.subtle",
|
|
225
|
+
"borderRadius]___[value:xxsmall",
|
|
226
|
+
"borderColor]___[value:stroke.info",
|
|
227
|
+
"textOverflow]___[value:ellipsis",
|
|
228
|
+
"whiteSpace]___[value:nowrap",
|
|
229
|
+
"inset]___[value:0]___[cond:_before",
|
|
230
|
+
"zIndex]___[value:0]___[cond:_before",
|
|
221
231
|
"textStyle]___[value:label.xsmall]___[cond:& a",
|
|
222
232
|
"marginInlineStart]___[value:1]___[cond:& a",
|
|
223
233
|
"borderRadius]___[value:0]___[cond:& img",
|
|
@@ -241,10 +251,8 @@
|
|
|
241
251
|
"transitionProperty]___[value:transform]___[cond:& svg",
|
|
242
252
|
"transitionDuration]___[value:normal]___[cond:& svg",
|
|
243
253
|
"transitionTimingFunction]___[value:ease-out]___[cond:& svg",
|
|
244
|
-
"
|
|
245
|
-
"
|
|
246
|
-
"whiteSpace]___[value:nowrap",
|
|
247
|
-
"textDecoration]___[value:none]___[cond:_focusWithin",
|
|
254
|
+
"alignSelf]___[value:flex-end",
|
|
255
|
+
"fill]___[value:icon.subtle",
|
|
248
256
|
"color]___[value:text.strong]___[cond:& a",
|
|
249
257
|
"marginTop]___[value:0]___[cond:& h1",
|
|
250
258
|
"marginBottom]___[value:medium",
|
|
@@ -291,12 +299,9 @@
|
|
|
291
299
|
"paddingInlineEnd]___[value:medium",
|
|
292
300
|
"paddingInlineStart]___[value:small",
|
|
293
301
|
"flexDirection]___[value:row",
|
|
294
|
-
"inset]___[value:0]___[cond:_before",
|
|
295
|
-
"zIndex]___[value:0]___[cond:_before",
|
|
296
302
|
"background]___[value:surface.infoSubtle",
|
|
297
303
|
"borderBlockEnd]___[value:1px solid",
|
|
298
304
|
"backgroundColor]___[value:surface.infoSubtle.hover]___[cond:_hover",
|
|
299
|
-
"gap]___[value:small",
|
|
300
305
|
"paddingInline]___[value:0",
|
|
301
306
|
"background]___[value:surface.brand.1.subtle]___[cond:_first",
|
|
302
307
|
"borderColor]___[value:stroke.default]___[cond:_first",
|
|
@@ -347,6 +352,7 @@
|
|
|
347
352
|
"whiteSpace]___[value:pre-wrap]___[cond:mobileWideDown<___>_open",
|
|
348
353
|
"maxHeight]___[value:none]___[cond:mobileWideDown<___>_open",
|
|
349
354
|
"display]___[value:none]___[cond:mobileWide",
|
|
355
|
+
"textDecoration]___[value:none]___[cond:_focusWithin",
|
|
350
356
|
"display]___[value:none]___[cond:mobileWideDown<___>_disabled",
|
|
351
357
|
"textDecoration]___[value:underline]___[cond:& h3",
|
|
352
358
|
"transitionProperty]___[value:width, height]___[cond:& [data-forward]",
|
package/dist/styles.css
CHANGED
|
@@ -160,6 +160,10 @@
|
|
|
160
160
|
min-height: var(--sizes-xxlarge);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
.gap_small {
|
|
164
|
+
gap: var(--spacing-small);
|
|
165
|
+
}
|
|
166
|
+
|
|
163
167
|
.mbs_medium {
|
|
164
168
|
margin-block-start: var(--spacing-medium);
|
|
165
169
|
}
|
|
@@ -441,6 +445,22 @@
|
|
|
441
445
|
background: var(--colors-background-subtle);
|
|
442
446
|
}
|
|
443
447
|
|
|
448
|
+
.c_text\.link {
|
|
449
|
+
color: var(--colors-text-link);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.bdr_xxsmall {
|
|
453
|
+
border-radius: xxsmall;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.tov_ellipsis {
|
|
457
|
+
text-overflow: ellipsis;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.white-space_nowrap {
|
|
461
|
+
white-space: nowrap;
|
|
462
|
+
}
|
|
463
|
+
|
|
444
464
|
.z_docked {
|
|
445
465
|
z-index: var(--z-index-docked);
|
|
446
466
|
}
|
|
@@ -469,16 +489,8 @@
|
|
|
469
489
|
border-radius: var(--radii-large);
|
|
470
490
|
}
|
|
471
491
|
|
|
472
|
-
.
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.c_text\.link {
|
|
477
|
-
color: var(--colors-text-link);
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
.white-space_nowrap {
|
|
481
|
-
white-space: nowrap;
|
|
492
|
+
.fill_icon\.subtle {
|
|
493
|
+
fill: var(--colors-icon-subtle);
|
|
482
494
|
}
|
|
483
495
|
|
|
484
496
|
.my_xxlarge {
|
|
@@ -509,10 +521,6 @@
|
|
|
509
521
|
border-block-end: 1px solid;
|
|
510
522
|
}
|
|
511
523
|
|
|
512
|
-
.gap_small {
|
|
513
|
-
gap: var(--spacing-small);
|
|
514
|
-
}
|
|
515
|
-
|
|
516
524
|
.px_0 {
|
|
517
525
|
padding-inline: 0;
|
|
518
526
|
}
|
|
@@ -581,6 +589,10 @@
|
|
|
581
589
|
align-items: flex-start;
|
|
582
590
|
}
|
|
583
591
|
|
|
592
|
+
.flex-wrap_wrap {
|
|
593
|
+
flex-wrap: wrap;
|
|
594
|
+
}
|
|
595
|
+
|
|
584
596
|
.bd-c_stroke\.subtle {
|
|
585
597
|
border-color: var(--colors-stroke-subtle);
|
|
586
598
|
}
|
|
@@ -609,10 +621,6 @@
|
|
|
609
621
|
flex-shrink: 0;
|
|
610
622
|
}
|
|
611
623
|
|
|
612
|
-
.flex-wrap_wrap {
|
|
613
|
-
flex-wrap: wrap;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
624
|
.ai_flex-end {
|
|
617
625
|
align-items: flex-end;
|
|
618
626
|
}
|
|
@@ -669,6 +677,14 @@
|
|
|
669
677
|
border-color: var(--colors-stroke-hover);
|
|
670
678
|
}
|
|
671
679
|
|
|
680
|
+
.bg-c_surface\.brand\.2\.subtle {
|
|
681
|
+
background-color: var(--colors-surface-brand-2-subtle);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.bd-c_stroke\.info {
|
|
685
|
+
border-color: var(--colors-stroke-info);
|
|
686
|
+
}
|
|
687
|
+
|
|
672
688
|
.top_xsmall {
|
|
673
689
|
top: var(--spacing-xsmall);
|
|
674
690
|
}
|
|
@@ -700,6 +716,10 @@
|
|
|
700
716
|
background-color: var(--colors-surface-action);
|
|
701
717
|
}
|
|
702
718
|
|
|
719
|
+
.as_flex-end {
|
|
720
|
+
align-self: flex-end;
|
|
721
|
+
}
|
|
722
|
+
|
|
703
723
|
.mb_medium {
|
|
704
724
|
margin-bottom: var(--spacing-medium);
|
|
705
725
|
}
|
|
@@ -895,6 +915,14 @@
|
|
|
895
915
|
width: 100%;
|
|
896
916
|
}
|
|
897
917
|
|
|
918
|
+
.before\:inset_0::before {
|
|
919
|
+
inset: 0;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
.before\:z_0::before {
|
|
923
|
+
z-index: 0;
|
|
924
|
+
}
|
|
925
|
+
|
|
898
926
|
.\[\&_a\]\:ms_1 a {
|
|
899
927
|
margin-inline-start: var(--spacing-1);
|
|
900
928
|
}
|
|
@@ -963,14 +991,6 @@
|
|
|
963
991
|
padding-block-end: var(--spacing-xsmall);
|
|
964
992
|
}
|
|
965
993
|
|
|
966
|
-
.before\:inset_0::before {
|
|
967
|
-
inset: 0;
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
.before\:z_0::before {
|
|
971
|
-
z-index: 0;
|
|
972
|
-
}
|
|
973
|
-
|
|
974
994
|
.first\:bg_surface\.brand\.1\.subtle:first-child {
|
|
975
995
|
background: var(--colors-surface-brand-1-subtle);
|
|
976
996
|
}
|
|
@@ -1126,6 +1146,10 @@
|
|
|
1126
1146
|
background: var(--colors-surface-action-subtle-hover);
|
|
1127
1147
|
}
|
|
1128
1148
|
|
|
1149
|
+
.hover\:td_unset:is(:hover, [data-hover]) {
|
|
1150
|
+
text-decoration: unset;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1129
1153
|
.hover\:bd-c_text\.link:is(:hover, [data-hover]) {
|
|
1130
1154
|
border-color: var(--colors-text-link);
|
|
1131
1155
|
}
|
package/es/Article/Article.js
CHANGED
|
@@ -100,6 +100,14 @@ const StyledStack = styled(Stack, {
|
|
|
100
100
|
minHeight: "xxlarge"
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
|
+
const StyledWrapper = styled("div", {
|
|
104
|
+
base: {
|
|
105
|
+
display: "flex",
|
|
106
|
+
gap: "small",
|
|
107
|
+
flexWrap: "wrap",
|
|
108
|
+
alignItems: "center"
|
|
109
|
+
}
|
|
110
|
+
});
|
|
103
111
|
export const ArticleTitle = _ref2 => {
|
|
104
112
|
let {
|
|
105
113
|
contentType,
|
|
@@ -109,7 +117,8 @@ export const ArticleTitle = _ref2 => {
|
|
|
109
117
|
id,
|
|
110
118
|
introduction,
|
|
111
119
|
contentTypeLabel,
|
|
112
|
-
competenceGoals
|
|
120
|
+
competenceGoals,
|
|
121
|
+
disclaimer
|
|
113
122
|
} = _ref2;
|
|
114
123
|
return /*#__PURE__*/_jsxs(ArticleHeader, {
|
|
115
124
|
children: [/*#__PURE__*/_jsxs(ArticleHGroup, {
|
|
@@ -137,7 +146,9 @@ export const ArticleTitle = _ref2 => {
|
|
|
137
146
|
children: /*#__PURE__*/_jsx("div", {
|
|
138
147
|
children: introduction
|
|
139
148
|
})
|
|
140
|
-
}),
|
|
149
|
+
}), /*#__PURE__*/_jsxs(StyledWrapper, {
|
|
150
|
+
children: [competenceGoals, disclaimer]
|
|
151
|
+
})]
|
|
141
152
|
});
|
|
142
153
|
};
|
|
143
154
|
export const Article = _ref3 => {
|
|
@@ -150,7 +161,8 @@ export const Article = _ref3 => {
|
|
|
150
161
|
contentTypeLabel,
|
|
151
162
|
id,
|
|
152
163
|
heartButton,
|
|
153
|
-
lang
|
|
164
|
+
lang,
|
|
165
|
+
disclaimer
|
|
154
166
|
} = _ref3;
|
|
155
167
|
const {
|
|
156
168
|
title,
|
|
@@ -170,7 +182,8 @@ export const Article = _ref3 => {
|
|
|
170
182
|
introduction: introduction,
|
|
171
183
|
competenceGoals: competenceGoals,
|
|
172
184
|
lang: lang,
|
|
173
|
-
contentTypeLabel: contentTypeLabel
|
|
185
|
+
contentTypeLabel: contentTypeLabel,
|
|
186
|
+
disclaimer: disclaimer
|
|
174
187
|
}), /*#__PURE__*/_jsx(ArticleContent, {
|
|
175
188
|
children: content
|
|
176
189
|
}), /*#__PURE__*/_jsxs(ArticleFooter, {
|
|
@@ -8,11 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
import { useEffect, useRef } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
import {
|
|
11
|
+
import { ArrowRightShortLine } from "@ndla/icons";
|
|
12
|
+
import { Figure, Text } from "@ndla/primitives";
|
|
13
|
+
import { SafeLink } from "@ndla/safelink";
|
|
12
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
|
+
import { linkOverlay } from "@ndla/styled-system/patterns";
|
|
13
16
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
14
17
|
import { ResourceBox } from "../ResourceBox";
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
19
|
const StyledFigure = styled(Figure, {
|
|
17
20
|
base: {
|
|
18
21
|
"& iframe": {
|
|
@@ -21,6 +24,55 @@ const StyledFigure = styled(Figure, {
|
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
});
|
|
27
|
+
|
|
28
|
+
// TODO: Move this to own component in UI? Use variant of existing?
|
|
29
|
+
const StyledSafeLink = styled(SafeLink, {
|
|
30
|
+
base: {
|
|
31
|
+
textDecoration: "underline",
|
|
32
|
+
textStyle: "label.large",
|
|
33
|
+
color: "text.link",
|
|
34
|
+
fontWeight: "bold",
|
|
35
|
+
_hover: {
|
|
36
|
+
textDecoration: "unset"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const LinkWrapper = styled("div", {
|
|
41
|
+
base: {
|
|
42
|
+
display: "flex",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "space-between",
|
|
45
|
+
gap: "xsmall"
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const TextWrapper = styled("div", {
|
|
49
|
+
base: {
|
|
50
|
+
display: "flex",
|
|
51
|
+
flexDirection: "column",
|
|
52
|
+
alignItems: "flex-start",
|
|
53
|
+
gap: "xxsmall"
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const Wrapper = styled("div", {
|
|
57
|
+
base: {
|
|
58
|
+
display: "flex",
|
|
59
|
+
width: "100%",
|
|
60
|
+
gap: "small",
|
|
61
|
+
flexDirection: "column",
|
|
62
|
+
backgroundColor: "surface.brand.2.subtle",
|
|
63
|
+
borderRadius: "xxsmall",
|
|
64
|
+
padding: "medium",
|
|
65
|
+
border: "1px solid",
|
|
66
|
+
borderColor: "stroke.info"
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const UrlText = styled(Text, {
|
|
70
|
+
base: {
|
|
71
|
+
textOverflow: "ellipsis",
|
|
72
|
+
whiteSpace: "nowrap",
|
|
73
|
+
overflow: "hidden"
|
|
74
|
+
}
|
|
75
|
+
});
|
|
24
76
|
const ExternalEmbed = _ref => {
|
|
25
77
|
let {
|
|
26
78
|
embed
|
|
@@ -63,11 +115,35 @@ const ExternalEmbed = _ref => {
|
|
|
63
115
|
})
|
|
64
116
|
});
|
|
65
117
|
}
|
|
118
|
+
if (embedData.type === "link") {
|
|
119
|
+
return /*#__PURE__*/_jsx(Figure, {
|
|
120
|
+
"data-embed-type": "external",
|
|
121
|
+
children: /*#__PURE__*/_jsxs(Wrapper, {
|
|
122
|
+
children: [/*#__PURE__*/_jsxs(LinkWrapper, {
|
|
123
|
+
children: [/*#__PURE__*/_jsxs(TextWrapper, {
|
|
124
|
+
children: [/*#__PURE__*/_jsx(StyledSafeLink, {
|
|
125
|
+
to: embedData.url,
|
|
126
|
+
unstyled: true,
|
|
127
|
+
css: linkOverlay.raw(),
|
|
128
|
+
children: embedData.title
|
|
129
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
130
|
+
textStyle: "label.medium",
|
|
131
|
+
children: embedData.caption
|
|
132
|
+
})]
|
|
133
|
+
}), /*#__PURE__*/_jsx(ArrowRightShortLine, {})]
|
|
134
|
+
}), /*#__PURE__*/_jsx(UrlText, {
|
|
135
|
+
textStyle: "label.medium",
|
|
136
|
+
color: "text.subtle",
|
|
137
|
+
children: embedData.url
|
|
138
|
+
})]
|
|
139
|
+
})
|
|
140
|
+
});
|
|
141
|
+
}
|
|
66
142
|
return /*#__PURE__*/_jsx(StyledFigure, {
|
|
67
143
|
"data-embed-type": "external",
|
|
68
144
|
ref: figRef,
|
|
69
145
|
dangerouslySetInnerHTML: {
|
|
70
|
-
__html: data
|
|
146
|
+
__html: data?.oembed?.html ?? ""
|
|
71
147
|
}
|
|
72
148
|
});
|
|
73
149
|
};
|
|
@@ -6,68 +6,73 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { useTranslation } from "react-i18next";
|
|
10
|
+
import { Portal } from "@ark-ui/react";
|
|
11
|
+
import { AccessibilityFill, ErrorWarningFill } from "@ndla/icons";
|
|
12
|
+
import { IconButton, PopoverContent, PopoverRoot, PopoverTrigger, PopoverTitle } from "@ndla/primitives";
|
|
12
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const
|
|
15
|
+
const DisclaimerWrapper = styled("div", {
|
|
15
16
|
base: {
|
|
16
17
|
display: "flex",
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
gap: "3xsmall",
|
|
20
|
+
clear: "both"
|
|
19
21
|
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const StyledIconButton = styled(IconButton, {
|
|
22
24
|
base: {
|
|
23
|
-
|
|
25
|
+
alignSelf: "flex-end"
|
|
24
26
|
}
|
|
25
27
|
});
|
|
26
|
-
const
|
|
28
|
+
const StyledErrorWarningFill = styled(ErrorWarningFill, {
|
|
27
29
|
base: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
textDecoration: "underline",
|
|
31
|
-
whiteSpace: "nowrap",
|
|
32
|
-
_hover: {
|
|
33
|
-
textDecoration: "none"
|
|
34
|
-
},
|
|
35
|
-
_focusWithin: {
|
|
36
|
-
textDecoration: "none"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const Wrapper = styled("div", {
|
|
41
|
-
base: {
|
|
42
|
-
clear: "both"
|
|
30
|
+
alignSelf: "flex-end",
|
|
31
|
+
fill: "icon.subtle"
|
|
43
32
|
}
|
|
44
33
|
});
|
|
45
34
|
const UuDisclaimerEmbed = _ref => {
|
|
46
35
|
let {
|
|
47
36
|
embed,
|
|
37
|
+
transformedDisclaimer,
|
|
48
38
|
children
|
|
49
39
|
} = _ref;
|
|
40
|
+
const {
|
|
41
|
+
t
|
|
42
|
+
} = useTranslation();
|
|
50
43
|
if (embed.status === "error") {
|
|
51
|
-
return
|
|
44
|
+
return /*#__PURE__*/_jsxs(DisclaimerWrapper, {
|
|
45
|
+
children: [/*#__PURE__*/_jsx(StyledErrorWarningFill, {
|
|
46
|
+
"aria-label": t("embed.embedError", {
|
|
47
|
+
type: t("embed.type.disclaimer")
|
|
48
|
+
}),
|
|
49
|
+
title: t("embed.embedError", {
|
|
50
|
+
type: t("embed.type.disclaimer")
|
|
51
|
+
})
|
|
52
|
+
}), children]
|
|
53
|
+
});
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
embedData,
|
|
55
|
-
data
|
|
56
|
-
} = embed;
|
|
57
|
-
const disclaimerLink = data?.disclaimerLink ? /*#__PURE__*/_jsx(StyledSafeLink, {
|
|
58
|
-
to: data.disclaimerLink.href,
|
|
59
|
-
target: "_blank",
|
|
60
|
-
rel: "noopener noreferrer",
|
|
61
|
-
children: data.disclaimerLink.text
|
|
62
|
-
}) : null;
|
|
63
|
-
return /*#__PURE__*/_jsxs(Wrapper, {
|
|
55
|
+
return /*#__PURE__*/_jsxs(DisclaimerWrapper, {
|
|
64
56
|
role: "region",
|
|
65
57
|
"data-embed-type": "uu-disclaimer",
|
|
66
|
-
children: [/*#__PURE__*/_jsxs(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
children: [/*#__PURE__*/_jsxs(PopoverRoot, {
|
|
59
|
+
children: [/*#__PURE__*/_jsx(PopoverTrigger, {
|
|
60
|
+
asChild: true,
|
|
61
|
+
children: /*#__PURE__*/_jsx(StyledIconButton, {
|
|
62
|
+
size: "small",
|
|
63
|
+
variant: "secondary",
|
|
64
|
+
"aria-label": t("uuDisclaimer.title"),
|
|
65
|
+
title: t("uuDisclaimer.title"),
|
|
66
|
+
children: /*#__PURE__*/_jsx(AccessibilityFill, {})
|
|
67
|
+
})
|
|
68
|
+
}), /*#__PURE__*/_jsx(Portal, {
|
|
69
|
+
children: /*#__PURE__*/_jsxs(PopoverContent, {
|
|
70
|
+
children: [/*#__PURE__*/_jsx(PopoverTitle, {
|
|
71
|
+
children: t("uuDisclaimer.title")
|
|
72
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
73
|
+
children: transformedDisclaimer
|
|
74
|
+
})]
|
|
75
|
+
})
|
|
71
76
|
})]
|
|
72
77
|
}), /*#__PURE__*/_jsx("div", {
|
|
73
78
|
"data-uu-content": "",
|
package/es/locale/messages-en.js
CHANGED
|
@@ -1405,9 +1405,13 @@ const messages = {
|
|
|
1405
1405
|
external: "External resource",
|
|
1406
1406
|
gloss: "Gloss",
|
|
1407
1407
|
copyright: "Text",
|
|
1408
|
-
code: "Code block"
|
|
1408
|
+
code: "Code block",
|
|
1409
|
+
disclaimer: "Accessibility warning"
|
|
1409
1410
|
}
|
|
1410
1411
|
},
|
|
1412
|
+
uuDisclaimer: {
|
|
1413
|
+
title: "Accessibility"
|
|
1414
|
+
},
|
|
1411
1415
|
gloss: {
|
|
1412
1416
|
examples: "Examples",
|
|
1413
1417
|
showExamples: "Show examples",
|
package/es/locale/messages-nb.js
CHANGED
|
@@ -1405,9 +1405,13 @@ const messages = {
|
|
|
1405
1405
|
external: "Ekstern ressurs",
|
|
1406
1406
|
gloss: "Glose",
|
|
1407
1407
|
copyright: "Tekst",
|
|
1408
|
-
code: "Kodeblokk"
|
|
1408
|
+
code: "Kodeblokk",
|
|
1409
|
+
disclaimer: "UU-advarsel"
|
|
1409
1410
|
}
|
|
1410
1411
|
},
|
|
1412
|
+
uuDisclaimer: {
|
|
1413
|
+
title: "Tilgjengelighet"
|
|
1414
|
+
},
|
|
1411
1415
|
gloss: {
|
|
1412
1416
|
examples: "Eksempler",
|
|
1413
1417
|
showExamples: "Vis eksempler",
|
package/es/locale/messages-nn.js
CHANGED
|
@@ -1405,9 +1405,13 @@ const messages = {
|
|
|
1405
1405
|
external: "Ekstern ressurs",
|
|
1406
1406
|
gloss: "Glose",
|
|
1407
1407
|
copyright: "Tekst",
|
|
1408
|
-
code: "Kodeblokk"
|
|
1408
|
+
code: "Kodeblokk",
|
|
1409
|
+
disclaimer: "UU-advarsel"
|
|
1409
1410
|
}
|
|
1410
1411
|
},
|
|
1412
|
+
uuDisclaimer: {
|
|
1413
|
+
title: "Tilgjengelighet"
|
|
1414
|
+
},
|
|
1411
1415
|
gloss: {
|
|
1412
1416
|
examples: "Eksempler",
|
|
1413
1417
|
showExamples: "Vis eksempler",
|
package/es/locale/messages-se.js
CHANGED
|
@@ -1405,9 +1405,13 @@ const messages = {
|
|
|
1405
1405
|
external: "Olgguldas resursa",
|
|
1406
1406
|
gloss: "Glose",
|
|
1407
1407
|
copyright: "Tekst",
|
|
1408
|
-
code: "Kodeblokk"
|
|
1408
|
+
code: "Kodeblokk",
|
|
1409
|
+
disclaimer: "UU-advarsel"
|
|
1409
1410
|
}
|
|
1410
1411
|
},
|
|
1412
|
+
uuDisclaimer: {
|
|
1413
|
+
title: "Tilgjengelighet"
|
|
1414
|
+
},
|
|
1411
1415
|
gloss: {
|
|
1412
1416
|
examples: "Ovdamearkkat",
|
|
1413
1417
|
showExamples: "Vis eksempler",
|
|
@@ -1405,9 +1405,13 @@ const messages = {
|
|
|
1405
1405
|
external: "Ekstern ressurs",
|
|
1406
1406
|
gloss: "Glosa",
|
|
1407
1407
|
copyright: "Tekst",
|
|
1408
|
-
code: "Kodeblokk"
|
|
1408
|
+
code: "Kodeblokk",
|
|
1409
|
+
disclaimer: "UU-advarsel"
|
|
1409
1410
|
}
|
|
1410
1411
|
},
|
|
1412
|
+
uuDisclaimer: {
|
|
1413
|
+
title: "Tilgjengelighet"
|
|
1414
|
+
},
|
|
1411
1415
|
gloss: {
|
|
1412
1416
|
examples: "Eksempler",
|
|
1413
1417
|
showExamples: "Vis eksempler",
|
package/lib/Article/Article.d.ts
CHANGED
|
@@ -26,8 +26,9 @@ interface ArticleTitleProps {
|
|
|
26
26
|
lang?: string;
|
|
27
27
|
title?: ReactNode;
|
|
28
28
|
introduction?: ReactNode;
|
|
29
|
+
disclaimer?: ReactNode;
|
|
29
30
|
}
|
|
30
|
-
export declare const ArticleTitle: ({ contentType, heartButton, title, lang, id, introduction, contentTypeLabel, competenceGoals, }: ArticleTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const ArticleTitle: ({ contentType, heartButton, title, lang, id, introduction, contentTypeLabel, competenceGoals, disclaimer, }: ArticleTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
interface Props {
|
|
32
33
|
heartButton?: ReactNode;
|
|
33
34
|
article: ArticleType;
|
|
@@ -38,6 +39,7 @@ interface Props {
|
|
|
38
39
|
competenceGoals?: ReactNode;
|
|
39
40
|
id: string;
|
|
40
41
|
lang?: string;
|
|
42
|
+
disclaimer?: ReactNode;
|
|
41
43
|
}
|
|
42
|
-
export declare const Article: ({ article, contentType, licenseBox, children, competenceGoals, contentTypeLabel, id, heartButton, lang, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare const Article: ({ article, contentType, licenseBox, children, competenceGoals, contentTypeLabel, id, heartButton, lang, disclaimer, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
43
45
|
export {};
|
package/lib/Article/Article.js
CHANGED
|
@@ -106,6 +106,14 @@ const StyledStack = (0, _jsx2.styled)(_jsx2.Stack, {
|
|
|
106
106
|
minHeight: "xxlarge"
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
+
const StyledWrapper = (0, _jsx2.styled)("div", {
|
|
110
|
+
base: {
|
|
111
|
+
display: "flex",
|
|
112
|
+
gap: "small",
|
|
113
|
+
flexWrap: "wrap",
|
|
114
|
+
alignItems: "center"
|
|
115
|
+
}
|
|
116
|
+
});
|
|
109
117
|
const ArticleTitle = _ref2 => {
|
|
110
118
|
let {
|
|
111
119
|
contentType,
|
|
@@ -115,7 +123,8 @@ const ArticleTitle = _ref2 => {
|
|
|
115
123
|
id,
|
|
116
124
|
introduction,
|
|
117
125
|
contentTypeLabel,
|
|
118
|
-
competenceGoals
|
|
126
|
+
competenceGoals,
|
|
127
|
+
disclaimer
|
|
119
128
|
} = _ref2;
|
|
120
129
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleHeader, {
|
|
121
130
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleHGroup, {
|
|
@@ -143,7 +152,9 @@ const ArticleTitle = _ref2 => {
|
|
|
143
152
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
144
153
|
children: introduction
|
|
145
154
|
})
|
|
146
|
-
}),
|
|
155
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledWrapper, {
|
|
156
|
+
children: [competenceGoals, disclaimer]
|
|
157
|
+
})]
|
|
147
158
|
});
|
|
148
159
|
};
|
|
149
160
|
exports.ArticleTitle = ArticleTitle;
|
|
@@ -157,7 +168,8 @@ const Article = _ref3 => {
|
|
|
157
168
|
contentTypeLabel,
|
|
158
169
|
id,
|
|
159
170
|
heartButton,
|
|
160
|
-
lang
|
|
171
|
+
lang,
|
|
172
|
+
disclaimer
|
|
161
173
|
} = _ref3;
|
|
162
174
|
const {
|
|
163
175
|
title,
|
|
@@ -177,7 +189,8 @@ const Article = _ref3 => {
|
|
|
177
189
|
introduction: introduction,
|
|
178
190
|
competenceGoals: competenceGoals,
|
|
179
191
|
lang: lang,
|
|
180
|
-
contentTypeLabel: contentTypeLabel
|
|
192
|
+
contentTypeLabel: contentTypeLabel,
|
|
193
|
+
disclaimer: disclaimer
|
|
181
194
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ArticleContent, {
|
|
182
195
|
children: content
|
|
183
196
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleFooter, {
|