@ndla/ui 56.0.3-alpha.0 → 56.0.4-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 +34 -5
- package/dist/styles.css +144 -18
- package/es/Article/Article.js +1 -5
- package/es/Article/ArticleContent.js +27 -0
- package/es/Article/index.js +2 -1
- package/es/Embed/ImageEmbed.js +2 -1
- package/es/ErrorMessage/ErrorMessage.js +2 -0
- package/es/FileList/File.js +78 -23
- package/es/FileList/FileList.js +32 -37
- package/es/FileList/PdfFile.js +17 -16
- package/es/FileList/index.js +3 -5
- package/es/Grid/Grid.js +69 -48
- package/es/Grid/GridParallaxItem.js +32 -0
- package/es/Grid/index.js +2 -1
- package/es/KeyFigure/KeyFigure.js +28 -33
- package/es/LinkBlock/LinkBlockSection.js +1 -0
- package/es/RelatedArticleList/RelatedArticleList.js +1 -1
- package/es/index.js +1 -4
- package/es/styles.css +144 -18
- package/lib/Article/Article.d.ts +0 -1
- package/lib/Article/Article.js +3 -7
- package/lib/Article/ArticleContent.d.ts +11 -0
- package/lib/Article/ArticleContent.js +33 -0
- package/lib/Article/index.d.ts +2 -1
- package/lib/Article/index.js +2 -1
- package/lib/Embed/ImageEmbed.js +2 -1
- package/lib/ErrorMessage/ErrorMessage.js +2 -0
- package/lib/FileList/File.d.ts +5 -3
- package/lib/FileList/File.js +78 -23
- package/lib/FileList/FileList.d.ts +6 -6
- package/lib/FileList/FileList.js +35 -38
- package/lib/FileList/PdfFile.d.ts +2 -2
- package/lib/FileList/PdfFile.js +17 -15
- package/lib/FileList/index.d.ts +3 -5
- package/lib/FileList/index.js +19 -18
- package/lib/Grid/Grid.d.ts +4 -7
- package/lib/Grid/Grid.js +71 -49
- package/lib/Grid/GridParallaxItem.d.ts +9 -0
- package/lib/Grid/GridParallaxItem.js +39 -0
- package/lib/Grid/index.d.ts +2 -1
- package/lib/Grid/index.js +4 -5
- package/lib/KeyFigure/KeyFigure.js +30 -33
- package/lib/LinkBlock/LinkBlockSection.js +1 -0
- package/lib/RelatedArticleList/RelatedArticleList.js +1 -1
- package/lib/index.d.ts +1 -4
- package/lib/index.js +9 -24
- package/lib/styles.css +144 -18
- package/package.json +7 -7
- package/src/Article/Article.tsx +1 -6
- package/src/Article/ArticleContent.tsx +21 -0
- package/src/Article/index.ts +2 -1
- package/src/ContentTypeBadge/ContentTypeBadge.stories.tsx +8 -7
- package/src/Embed/ImageEmbed.tsx +3 -2
- package/src/ErrorMessage/ErrorMessage.tsx +2 -0
- package/src/FileList/File.tsx +63 -28
- package/src/FileList/FileList.stories.tsx +121 -12
- package/src/FileList/FileList.tsx +31 -37
- package/src/FileList/PdfFile.tsx +9 -9
- package/src/FileList/index.ts +3 -7
- package/src/Grid/Grid.stories.tsx +30 -31
- package/src/Grid/Grid.tsx +57 -85
- package/src/Grid/GridParallaxItem.tsx +26 -0
- package/src/Grid/index.ts +3 -1
- package/src/KeyFigure/KeyFigure.stories.tsx +18 -11
- package/src/KeyFigure/KeyFigure.tsx +33 -47
- package/src/LinkBlock/LinkBlockSection.tsx +1 -1
- package/src/RelatedArticleList/RelatedArticleList.tsx +1 -1
- package/src/index.ts +1 -7
- package/es/FileList/Format.js +0 -93
- package/es/Footer/FooterBlock.js +0 -17
- package/es/Footer/index.js +0 -9
- package/es/Messages/MessageBox.js +0 -79
- package/es/Messages/index.js +0 -10
- package/es/utils/resourceTypeColor.js +0 -46
- package/lib/FileList/Format.d.ts +0 -16
- package/lib/FileList/Format.js +0 -98
- package/lib/Footer/FooterBlock.d.ts +0 -13
- package/lib/Footer/FooterBlock.js +0 -24
- package/lib/Footer/index.d.ts +0 -8
- package/lib/Footer/index.js +0 -12
- package/lib/Messages/MessageBox.d.ts +0 -23
- package/lib/Messages/MessageBox.js +0 -87
- package/lib/Messages/index.d.ts +0 -9
- package/lib/Messages/index.js +0 -13
- package/lib/utils/resourceTypeColor.d.ts +0 -9
- package/lib/utils/resourceTypeColor.js +0 -54
- package/src/FileList/Format.tsx +0 -83
- package/src/Footer/Footer.stories.tsx +0 -35
- package/src/Footer/FooterBlock.tsx +0 -30
- package/src/Footer/index.ts +0 -9
- package/src/Messages/MessageBox.stories.tsx +0 -95
- package/src/Messages/MessageBox.tsx +0 -126
- package/src/Messages/index.ts +0 -11
- package/src/utils/resourceTypeColor.tsx +0 -46
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"schemaVersion": "0.44.0",
|
|
3
3
|
"styles": {
|
|
4
4
|
"atomic": [
|
|
5
|
-
"width]___[value:100%",
|
|
6
5
|
"display]___[value:flex",
|
|
7
6
|
"flexDirection]___[value:column",
|
|
8
7
|
"color]___[value:text.default",
|
|
@@ -11,6 +10,7 @@
|
|
|
11
10
|
"paddingBlock]___[value:xsmall",
|
|
12
11
|
"paddingInline]___[value:8%",
|
|
13
12
|
"alignItems]___[value:center",
|
|
13
|
+
"width]___[value:100%",
|
|
14
14
|
"overflowWrap]___[value:break-word",
|
|
15
15
|
"position]___[value:relative",
|
|
16
16
|
"paddingBlock]___[value:medium]___[cond:tablet",
|
|
@@ -331,14 +331,46 @@
|
|
|
331
331
|
"transitionDuration]___[value:fast]___[cond:& svg",
|
|
332
332
|
"transform]___[value:rotate(180deg)]___[cond:_open<___>& svg",
|
|
333
333
|
"display]___[value:none]___[cond:_print",
|
|
334
|
+
"textUnderlineOffset]___[value:2px",
|
|
335
|
+
"paddingBlock]___[value:small",
|
|
336
|
+
"paddingInlineEnd]___[value:medium",
|
|
337
|
+
"paddingInlineStart]___[value:small",
|
|
338
|
+
"flexDirection]___[value:row",
|
|
339
|
+
"inset]___[value:0]___[cond:_before",
|
|
340
|
+
"zIndex]___[value:0]___[cond:_before",
|
|
341
|
+
"background]___[value:surface.infoSubtle",
|
|
342
|
+
"borderBlockEnd]___[value:1px solid",
|
|
343
|
+
"backgroundColor]___[value:surface.infoSubtle.hover]___[cond:_hover",
|
|
334
344
|
"gap]___[value:small",
|
|
335
345
|
"paddingInline]___[value:0",
|
|
336
346
|
"marginBlockStart]___[value:3xsmall",
|
|
337
|
-
"paddingBlock]___[value:small",
|
|
338
347
|
"background]___[value:surface.brand.1.subtle]___[cond:_first",
|
|
339
348
|
"borderColor]___[value:stroke.default]___[cond:_first",
|
|
340
349
|
"fontWeight]___[value:bold]___[cond:_first<___>& p",
|
|
341
350
|
"fontStyle]___[value:italic",
|
|
351
|
+
"display]___[value:grid",
|
|
352
|
+
"gridRowGap]___[value:large",
|
|
353
|
+
"gridColumnGap]___[value:medium",
|
|
354
|
+
"backgroundColor]___[value:background.subtle",
|
|
355
|
+
"maxWidth]___[value:surface.4xlarge",
|
|
356
|
+
"gridTemplateColumns]___[value:repeat(2, minmax(0, 1fr))",
|
|
357
|
+
"gridTemplateColumns]___[value:repeat(1, minmax(0, 1fr))]___[cond:tabletDown",
|
|
358
|
+
"gridTemplateColumns]___[value:repeat(2, minmax(0, 1fr))]___[cond:tabletToDesktop",
|
|
359
|
+
"display]___[value:flex]___[cond:tabletToDesktop<___>& > div:nth-child(3):last-child",
|
|
360
|
+
"flexFlow]___[value:column]___[cond:tabletToDesktop<___>& > div:nth-child(3):last-child",
|
|
361
|
+
"justifyContent]___[value:center]___[cond:tabletToDesktop<___>& > div:nth-child(3):last-child",
|
|
362
|
+
"alignItems]___[value:center]___[cond:tabletToDesktop<___>& > div:nth-child(3):last-child",
|
|
363
|
+
"gridColumn]___[value:span 2]___[cond:tabletToDesktop<___>& > div:nth-child(3):last-child",
|
|
364
|
+
"gridTemplateColumns]___[value:repeat(3, minmax(0, 1fr))]___[cond:desktop",
|
|
365
|
+
"gridTemplateColumns]___[value:repeat(4, minmax(0, 1fr))]___[cond:desktop",
|
|
366
|
+
"backgroundColor]___[value:surface.default",
|
|
367
|
+
"backgroundColor]___[value:transparent",
|
|
368
|
+
"borderColor]___[value:surface.brand.2",
|
|
369
|
+
"top]___[value:var(--masthead-height, 0px)]___[cond:& > div",
|
|
370
|
+
"position]___[value:sticky]___[cond:& > div",
|
|
371
|
+
"width]___[value:surface.3xsmall",
|
|
372
|
+
"textStyle]___[value:heading.large",
|
|
373
|
+
"textStyle]___[value:title.medium",
|
|
342
374
|
"position]___[value:relative!",
|
|
343
375
|
"width]___[value:83.333%",
|
|
344
376
|
"right]___[value:auto !important",
|
|
@@ -388,9 +420,6 @@
|
|
|
388
420
|
"width]___[value:large]___[cond:_hover<___>& [data-forward]",
|
|
389
421
|
"height]___[value:large]___[cond:_hover<___>& [data-forward]",
|
|
390
422
|
"color]___[value:icon.strong",
|
|
391
|
-
"inset]___[value:0]___[cond:_before",
|
|
392
|
-
"zIndex]___[value:0]___[cond:_before",
|
|
393
|
-
"display]___[value:grid",
|
|
394
423
|
"gridTemplateColumns]___[value:repeat(2, 1fr)",
|
|
395
424
|
"gridTemplateColumns]___[value:1fr]___[cond:tabletDown",
|
|
396
425
|
"marginBlockStart]___[value:xsmall",
|
package/dist/styles.css
CHANGED
|
@@ -48,6 +48,30 @@
|
|
|
48
48
|
line-height: calc(var(--line-heights-medium) * 1.11);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
.textStyle_heading\.large {
|
|
52
|
+
font-family: var(--fonts-sans);
|
|
53
|
+
font-weight: var(--font-weights-bold);
|
|
54
|
+
font-size: var(--font-sizes-4xlarge);
|
|
55
|
+
line-height: var(--line-heights-4xlarge);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.textStyle_heading\.large:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
59
|
+
font-size: calc(var(--font-sizes-4xlarge) * 1.11);
|
|
60
|
+
line-height: calc(var(--line-heights-4xlarge) * 1.11);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.textStyle_title\.medium {
|
|
64
|
+
font-family: var(--fonts-sans);
|
|
65
|
+
font-weight: var(--font-weights-bold);
|
|
66
|
+
font-size: var(--font-sizes-large);
|
|
67
|
+
line-height: var(--line-heights-large);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.textStyle_title\.medium:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
71
|
+
font-size: calc(var(--font-sizes-large) * 1.11);
|
|
72
|
+
line-height: calc(var(--line-heights-large) * 1.11);
|
|
73
|
+
}
|
|
74
|
+
|
|
51
75
|
.\[\&_a\]\:textStyle_label\.xsmall a {
|
|
52
76
|
font-family: var(--fonts-sans);
|
|
53
77
|
font-weight: var(--font-weights-normal);
|
|
@@ -61,10 +85,6 @@
|
|
|
61
85
|
}
|
|
62
86
|
}
|
|
63
87
|
|
|
64
|
-
.w_100\% {
|
|
65
|
-
width: 100%;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
88
|
.d_flex {
|
|
69
89
|
display: flex;
|
|
70
90
|
}
|
|
@@ -89,6 +109,10 @@
|
|
|
89
109
|
padding-inline: 8%;
|
|
90
110
|
}
|
|
91
111
|
|
|
112
|
+
.w_100\% {
|
|
113
|
+
width: 100%;
|
|
114
|
+
}
|
|
115
|
+
|
|
92
116
|
.ov-wrap_break-word {
|
|
93
117
|
overflow-wrap: break-word;
|
|
94
118
|
}
|
|
@@ -491,6 +515,30 @@
|
|
|
491
515
|
clear: both;
|
|
492
516
|
}
|
|
493
517
|
|
|
518
|
+
.tu-o_2px {
|
|
519
|
+
text-underline-offset: 2px;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.py_small {
|
|
523
|
+
padding-block: var(--spacing-small);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.pe_medium {
|
|
527
|
+
padding-inline-end: var(--spacing-medium);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.ps_small {
|
|
531
|
+
padding-inline-start: var(--spacing-small);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.bg_surface\.infoSubtle {
|
|
535
|
+
background: var(--colors-surface-info-subtle);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.bd-be_1px_solid {
|
|
539
|
+
border-block-end: 1px solid;
|
|
540
|
+
}
|
|
541
|
+
|
|
494
542
|
.gap_small {
|
|
495
543
|
gap: var(--spacing-small);
|
|
496
544
|
}
|
|
@@ -503,8 +551,16 @@
|
|
|
503
551
|
margin-block-start: var(--spacing-3xsmall);
|
|
504
552
|
}
|
|
505
553
|
|
|
506
|
-
.
|
|
507
|
-
|
|
554
|
+
.d_grid {
|
|
555
|
+
display: grid;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.max-w_surface\.4xlarge {
|
|
559
|
+
max-width: var(--sizes-surface-4xlarge);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.w_surface\.3xsmall {
|
|
563
|
+
width: var(--sizes-surface-3xsmall);
|
|
508
564
|
}
|
|
509
565
|
|
|
510
566
|
.pos_relative\! {
|
|
@@ -547,10 +603,6 @@
|
|
|
547
603
|
color: var(--colors-icon-strong);
|
|
548
604
|
}
|
|
549
605
|
|
|
550
|
-
.d_grid {
|
|
551
|
-
display: grid;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
606
|
.mbs_xsmall {
|
|
555
607
|
margin-block-start: var(--spacing-xsmall);
|
|
556
608
|
}
|
|
@@ -760,10 +812,42 @@
|
|
|
760
812
|
bottom: calc(var(--spacing-medium) * -1);
|
|
761
813
|
}
|
|
762
814
|
|
|
815
|
+
.flex-d_row {
|
|
816
|
+
flex-direction: row;
|
|
817
|
+
}
|
|
818
|
+
|
|
763
819
|
.font-style_italic {
|
|
764
820
|
font-style: italic;
|
|
765
821
|
}
|
|
766
822
|
|
|
823
|
+
.grid-rg_large {
|
|
824
|
+
grid-row-gap: var(--spacing-large);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.grid-cg_medium {
|
|
828
|
+
grid-column-gap: var(--spacing-medium);
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.bg-c_background\.subtle {
|
|
832
|
+
background-color: var(--colors-background-subtle);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
.grid-tc_repeat\(2\,_minmax\(0\,_1fr\)\) {
|
|
836
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
.bg-c_surface\.default {
|
|
840
|
+
background-color: var(--colors-surface-default);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.bg-c_transparent {
|
|
844
|
+
background-color: transparent;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.bd-c_surface\.brand\.2 {
|
|
848
|
+
border-color: var(--colors-surface-brand-2);
|
|
849
|
+
}
|
|
850
|
+
|
|
767
851
|
.right_auto\! {
|
|
768
852
|
right: auto !important;
|
|
769
853
|
}
|
|
@@ -1059,10 +1143,22 @@
|
|
|
1059
1143
|
padding-block-end: var(--spacing-xsmall);
|
|
1060
1144
|
}
|
|
1061
1145
|
|
|
1146
|
+
.before\:inset_0::before {
|
|
1147
|
+
inset: 0;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
.before\:z_0::before {
|
|
1151
|
+
z-index: 0;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1062
1154
|
.first\:bg_surface\.brand\.1\.subtle:first-child {
|
|
1063
1155
|
background: var(--colors-surface-brand-1-subtle);
|
|
1064
1156
|
}
|
|
1065
1157
|
|
|
1158
|
+
.\[\&_\>_div\]\:pos_sticky > div {
|
|
1159
|
+
position: sticky;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1066
1162
|
.after\:d_block\!::after {
|
|
1067
1163
|
display: block !important;
|
|
1068
1164
|
}
|
|
@@ -1075,14 +1171,6 @@
|
|
|
1075
1171
|
text-decoration: underline;
|
|
1076
1172
|
}
|
|
1077
1173
|
|
|
1078
|
-
.before\:inset_0::before {
|
|
1079
|
-
inset: 0;
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
.before\:z_0::before {
|
|
1083
|
-
z-index: 0;
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
1174
|
.after\:content_0::after {
|
|
1087
1175
|
content: 0;
|
|
1088
1176
|
}
|
|
@@ -1187,6 +1275,10 @@
|
|
|
1187
1275
|
border-color: var(--colors-stroke-default);
|
|
1188
1276
|
}
|
|
1189
1277
|
|
|
1278
|
+
.\[\&_\>_div\]\:top_var\(--masthead-height\,_0px\) > div {
|
|
1279
|
+
top: var(--masthead-height, 0px);
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1190
1282
|
.after\:content_\"\"\!::after {
|
|
1191
1283
|
content: "" !important;
|
|
1192
1284
|
}
|
|
@@ -1243,6 +1335,10 @@
|
|
|
1243
1335
|
border-color: var(--colors-text-link);
|
|
1244
1336
|
}
|
|
1245
1337
|
|
|
1338
|
+
.hover\:bg-c_surface\.infoSubtle\.hover:is(:hover, [data-hover]) {
|
|
1339
|
+
background-color: var(--colors-surface-info-subtle-hover);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1246
1342
|
.active\:bg_surface\.actionSubtle\.active:is(:active, [data-active]) {
|
|
1247
1343
|
background: var(--colors-surface-action-subtle-active);
|
|
1248
1344
|
}
|
|
@@ -1397,6 +1493,27 @@
|
|
|
1397
1493
|
.\[\&_svg\]\:tablet\:h_12px svg {
|
|
1398
1494
|
height: 12px;
|
|
1399
1495
|
}
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
@media screen and (min-width: 37.5625rem) and (max-width: 61.31rem) {
|
|
1499
|
+
.tabletToDesktop\:grid-tc_repeat\(2\,_minmax\(0\,_1fr\)\) {
|
|
1500
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1501
|
+
}
|
|
1502
|
+
.tabletToDesktop\:\[\&_\>_div\:nth-child\(3\)\:last-child\]\:d_flex > div:nth-child(3):last-child {
|
|
1503
|
+
display: flex;
|
|
1504
|
+
}
|
|
1505
|
+
.tabletToDesktop\:\[\&_\>_div\:nth-child\(3\)\:last-child\]\:flex-flow_column > div:nth-child(3):last-child {
|
|
1506
|
+
flex-flow: column;
|
|
1507
|
+
}
|
|
1508
|
+
.tabletToDesktop\:\[\&_\>_div\:nth-child\(3\)\:last-child\]\:grid-c_span_2 > div:nth-child(3):last-child {
|
|
1509
|
+
grid-column: span 2;
|
|
1510
|
+
}
|
|
1511
|
+
.tabletToDesktop\:\[\&_\>_div\:nth-child\(3\)\:last-child\]\:jc_center > div:nth-child(3):last-child {
|
|
1512
|
+
justify-content: center;
|
|
1513
|
+
}
|
|
1514
|
+
.tabletToDesktop\:\[\&_\>_div\:nth-child\(3\)\:last-child\]\:ai_center > div:nth-child(3):last-child {
|
|
1515
|
+
align-items: center;
|
|
1516
|
+
}
|
|
1400
1517
|
}
|
|
1401
1518
|
|
|
1402
1519
|
@media screen and (min-width: 48rem) {
|
|
@@ -1435,6 +1552,12 @@
|
|
|
1435
1552
|
}
|
|
1436
1553
|
.desktop\:top_xxlarge {
|
|
1437
1554
|
top: var(--spacing-xxlarge);
|
|
1555
|
+
}
|
|
1556
|
+
.desktop\:grid-tc_repeat\(3\,_minmax\(0\,_1fr\)\) {
|
|
1557
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
1558
|
+
}
|
|
1559
|
+
.desktop\:grid-tc_repeat\(4\,_minmax\(0\,_1fr\)\) {
|
|
1560
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
1438
1561
|
}
|
|
1439
1562
|
}
|
|
1440
1563
|
|
|
@@ -1495,6 +1618,9 @@
|
|
|
1495
1618
|
}
|
|
1496
1619
|
.tabletDown\:bdr_0 {
|
|
1497
1620
|
border-radius: 0;
|
|
1621
|
+
}
|
|
1622
|
+
.tabletDown\:grid-tc_repeat\(1\,_minmax\(0\,_1fr\)\) {
|
|
1623
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
1498
1624
|
}
|
|
1499
1625
|
.tabletDown\:grid-tc_1fr {
|
|
1500
1626
|
grid-template-columns: 1fr;
|
package/es/Article/Article.js
CHANGED
|
@@ -9,13 +9,9 @@
|
|
|
9
9
|
import { Heading, Text } from "@ndla/primitives";
|
|
10
10
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
11
|
import ArticleByline from "./ArticleByline";
|
|
12
|
+
import { ArticleContent } from "./ArticleContent";
|
|
12
13
|
import { ContentTypeBadgeNew } from "..";
|
|
13
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
export const ArticleContent = styled("section", {
|
|
15
|
-
base: {
|
|
16
|
-
width: "100%"
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
15
|
export const ArticleWrapper = styled("article", {
|
|
20
16
|
base: {
|
|
21
17
|
display: "flex",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
|
+
import { ark } from "@ark-ui/react";
|
|
11
|
+
import { cx } from "@ndla/styled-system/css";
|
|
12
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const StyledArticleContent = styled(ark.section, {}, {
|
|
15
|
+
baseComponent: true
|
|
16
|
+
});
|
|
17
|
+
export const ArticleContent = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
18
|
+
let {
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_jsx(StyledArticleContent, {
|
|
23
|
+
className: cx("ndla-article", className),
|
|
24
|
+
...props,
|
|
25
|
+
ref: ref
|
|
26
|
+
});
|
|
27
|
+
});
|
package/es/Article/index.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import ArticleByline from "./ArticleByline";
|
|
10
10
|
import ArticleFootNotes from "./ArticleFootNotes";
|
|
11
|
-
export { Article,
|
|
11
|
+
export { Article, ArticleWrapper, ArticleHeader, ArticleFooter } from "./Article";
|
|
12
|
+
export { ArticleContent } from "./ArticleContent";
|
|
12
13
|
export { ArticleByline, ArticleFootNotes };
|
|
13
14
|
export { ArticleParagraph } from "./ArticleParagraph";
|
package/es/Embed/ImageEmbed.js
CHANGED
|
@@ -27,10 +27,11 @@ export const errorSvgSrc = `data:image/svg+xml;charset=UTF-8,%3Csvg fill='%238A8
|
|
|
27
27
|
const getFigureProps = (size, float) => {
|
|
28
28
|
const actualFloat = float === "left" ? "left" : float === "right" ? "right" : undefined;
|
|
29
29
|
const replacedSize = size?.replace("-hide-byline", "") ?? "full";
|
|
30
|
+
const actualSize = replacedSize === "fullwidth" ? "full" : replacedSize;
|
|
30
31
|
return {
|
|
31
32
|
float: actualFloat,
|
|
32
33
|
// Figure expects you to set a size when floating. If you don't, the figure will simply take up the available width. Fallback to medium in those cases.
|
|
33
|
-
size:
|
|
34
|
+
size: actualSize === "full" && float ? "medium" : actualSize
|
|
34
35
|
};
|
|
35
36
|
};
|
|
36
37
|
const getSizes = (size, align) => {
|
package/es/FileList/File.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) 2023-present, NDLA.
|
|
4
3
|
*
|
|
@@ -7,38 +6,94 @@ import _styled from "@emotion/styled/base";
|
|
|
7
6
|
*
|
|
8
7
|
*/
|
|
9
8
|
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
import { DownloadLine } from "@ndla/icons/common";
|
|
12
|
+
import { Text } from "@ndla/primitives";
|
|
13
|
+
import { SafeLink } from "@ndla/safelink";
|
|
14
|
+
import { HStack, styled } from "@ndla/styled-system/jsx";
|
|
15
|
+
import { linkOverlay } from "@ndla/styled-system/patterns";
|
|
16
|
+
import { FileListItem } from ".";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
const StyledSafeLink = styled(SafeLink, {
|
|
19
|
+
base: {
|
|
20
|
+
textUnderlineOffset: "2px",
|
|
21
|
+
textDecoration: "underline",
|
|
22
|
+
_hover: {
|
|
23
|
+
textDecoration: "none"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const StyledHStack = styled(HStack, {
|
|
28
|
+
base: {
|
|
29
|
+
position: "relative",
|
|
30
|
+
paddingBlock: "small",
|
|
31
|
+
paddingInlineEnd: "medium",
|
|
32
|
+
paddingInlineStart: "small",
|
|
33
|
+
width: "100%"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export const File = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
21
37
|
let {
|
|
22
38
|
title,
|
|
23
39
|
url,
|
|
24
40
|
fileExists,
|
|
25
|
-
fileType
|
|
41
|
+
fileType,
|
|
42
|
+
fileSize,
|
|
43
|
+
...rest
|
|
26
44
|
} = _ref;
|
|
27
45
|
const {
|
|
28
46
|
t
|
|
29
47
|
} = useTranslation();
|
|
30
48
|
const tooltip = `${t("download")} ${url.split("/").pop()}`;
|
|
31
|
-
return /*#__PURE__*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
49
|
+
return /*#__PURE__*/_jsxs(StyledHStack, {
|
|
50
|
+
justify: "space-between",
|
|
51
|
+
ref: ref,
|
|
52
|
+
...rest,
|
|
53
|
+
children: [/*#__PURE__*/_jsxs(HStack, {
|
|
54
|
+
gap: "xxsmall",
|
|
55
|
+
children: [/*#__PURE__*/_jsx(DownloadLine, {}), fileExists ? /*#__PURE__*/_jsx(StyledSafeLink, {
|
|
56
|
+
unstyled: true,
|
|
57
|
+
css: linkOverlay.raw(),
|
|
58
|
+
to: url,
|
|
59
|
+
title: tooltip,
|
|
60
|
+
children: title
|
|
61
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
62
|
+
textStyle: "label.medium",
|
|
63
|
+
children: title
|
|
64
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
65
|
+
textStyle: "label.large",
|
|
66
|
+
asChild: true,
|
|
67
|
+
consumeCss: true,
|
|
68
|
+
children: /*#__PURE__*/_jsxs("span", {
|
|
69
|
+
children: ["(", fileType?.toUpperCase(), ")"]
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
73
|
+
textStyle: "label.large",
|
|
74
|
+
asChild: true,
|
|
75
|
+
consumeCss: true,
|
|
76
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
77
|
+
children: fileSize
|
|
78
|
+
})
|
|
79
|
+
})]
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
export const FileListElement = _ref2 => {
|
|
83
|
+
let {
|
|
84
|
+
title,
|
|
85
|
+
url,
|
|
86
|
+
fileExists,
|
|
87
|
+
fileType,
|
|
88
|
+
fileSize
|
|
89
|
+
} = _ref2;
|
|
90
|
+
return /*#__PURE__*/_jsx(FileListItem, {
|
|
91
|
+
children: /*#__PURE__*/_jsx(File, {
|
|
39
92
|
title: title,
|
|
40
|
-
|
|
93
|
+
url: url,
|
|
94
|
+
fileExists: fileExists,
|
|
95
|
+
fileType: fileType,
|
|
96
|
+
fileSize: fileSize
|
|
41
97
|
})
|
|
42
98
|
});
|
|
43
|
-
};
|
|
44
|
-
export default File;
|
|
99
|
+
};
|
package/es/FileList/FileList.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
1
|
/**
|
|
4
2
|
* Copyright (c) 2023-present, NDLA.
|
|
5
3
|
*
|
|
@@ -9,52 +7,49 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
9
|
import { useTranslation } from "react-i18next";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { Heading } from "@ndla/primitives";
|
|
11
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
14
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
label: "FileListHeaderWrapper"
|
|
22
|
-
})("display:flex;justify-content:space-between;align-items:center;margin:0 0 ", spacing.xsmall, " 0;padding-bottom:", spacing.xsmall, ";border-bottom:2px solid ", colors.brand.greyLight, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpbGVMaXN0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5QndDIiwiZmlsZSI6IkZpbGVMaXN0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IChjKSAyMDIzLXByZXNlbnQsIE5ETEEuXG4gKlxuICogVGhpcyBzb3VyY2UgY29kZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgR1BMdjMgbGljZW5zZSBmb3VuZCBpbiB0aGVcbiAqIExJQ0VOU0UgZmlsZSBpbiB0aGUgcm9vdCBkaXJlY3Rvcnkgb2YgdGhpcyBzb3VyY2UgdHJlZS5cbiAqXG4gKi9cblxuaW1wb3J0IHsgQ29tcG9uZW50UHJvcHMsIFJlYWN0Tm9kZSB9IGZyb20gXCJyZWFjdFwiO1xuaW1wb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VsYFxuICBwYWRkaW5nOiAwO1xuYDtcblxuY29uc3QgRmlsZUxpc3QgPSAoeyBjaGlsZHJlbiwgaGVhZGluZ0J1dHRvbnMsIC4uLnJlc3QgfTogUHJvcHMpID0+IHtcbiAgY29uc3QgeyB0IH0gPSB1c2VUcmFuc2xhdGlvbigpO1xuICByZXR1cm4gKFxuICAgIDxGaWxlTGlzdFNlY3Rpb24gey4uLnJlc3R9PlxuICAgICAgPEZpbGVMaXN0SGVhZGVyV3JhcHBlcj5cbiAgICAgICAgPEhlYWRpbmcgZWxlbWVudD1cImgzXCIgaGVhZGluZ1N0eWxlPVwibGlzdC10aXRsZVwiIG1hcmdpbj1cIm5vbmVcIj5cbiAgICAgICAgICB7dChcImZpbGVzXCIpfVxuICAgICAgICA8L0hlYWRpbmc+XG4gICAgICAgIDxkaXY+e2hlYWRpbmdCdXR0b25zfTwvZGl2PlxuICAgICAgPC9GaWxlTGlzdEhlYWRlcldyYXBwZXI+XG4gICAgICA8RmlsZXNMaXN0PntjaGlsZHJlbn08L0ZpbGVzTGlzdD5cbiAgICA8L0ZpbGVMaXN0U2VjdGlvbj5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEZpbGVMaXN0O1xuIl19 */"));
|
|
23
|
-
const FilesList = /*#__PURE__*/_styled("ul", {
|
|
24
|
-
target: "e1o67ylf0",
|
|
25
|
-
label: "FilesList"
|
|
26
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
27
|
-
name: "1hcx8jb",
|
|
28
|
-
styles: "padding:0"
|
|
29
|
-
} : {
|
|
30
|
-
name: "1hcx8jb",
|
|
31
|
-
styles: "padding:0",
|
|
32
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpbGVMaXN0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrQzJCIiwiZmlsZSI6IkZpbGVMaXN0LnRzeCIsInNvdXJjZXND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rapper = styled("div", {
|
|
14
|
+
base: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
gap: "xsmall"
|
|
18
|
+
}
|
|
34
19
|
});
|
|
35
|
-
const
|
|
20
|
+
export const FileListItem = styled("li", {
|
|
21
|
+
base: {
|
|
22
|
+
background: "surface.infoSubtle",
|
|
23
|
+
borderBlockEnd: "1px solid",
|
|
24
|
+
borderColor: "stroke.default",
|
|
25
|
+
display: "flex",
|
|
26
|
+
justifyContent: "space-between",
|
|
27
|
+
_hover: {
|
|
28
|
+
backgroundColor: "surface.infoSubtle.hover"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export const FileListEmbed = _ref => {
|
|
36
33
|
let {
|
|
37
34
|
children,
|
|
38
|
-
headingButtons,
|
|
39
35
|
...rest
|
|
40
36
|
} = _ref;
|
|
41
37
|
const {
|
|
42
38
|
t
|
|
43
39
|
} = useTranslation();
|
|
44
|
-
return /*#__PURE__*/_jsxs(
|
|
40
|
+
return /*#__PURE__*/_jsxs(FileListWrapper, {
|
|
45
41
|
...rest,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
"data-embed-type": "file-list",
|
|
43
|
+
children: [/*#__PURE__*/_jsx(Heading, {
|
|
44
|
+
fontWeight: "bold",
|
|
45
|
+
textStyle: "heading.small",
|
|
46
|
+
asChild: true,
|
|
47
|
+
consumeCss: true,
|
|
48
|
+
children: /*#__PURE__*/_jsx("h3", {
|
|
51
49
|
children: t("files")
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
})]
|
|
55
|
-
}), /*#__PURE__*/_jsx(FilesList, {
|
|
50
|
+
})
|
|
51
|
+
}), /*#__PURE__*/_jsx("ul", {
|
|
56
52
|
children: children
|
|
57
53
|
})]
|
|
58
54
|
});
|
|
59
|
-
};
|
|
60
|
-
export default FileList;
|
|
55
|
+
};
|