@ndla/ui 56.0.5-alpha.0 → 56.0.7-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 +10 -12
- package/dist/styles.css +28 -36
- package/es/Article/Article.js +149 -42
- package/es/Article/ArticleByline.js +40 -40
- package/es/Article/ArticleFootNotes.js +2 -3
- package/es/Article/index.js +3 -5
- package/es/CampaignBlock/CampaignBlock.js +0 -6
- package/es/Concept/Concept.js +1 -1
- package/es/ContactBlock/ContactBlock.js +0 -1
- package/es/Embed/ConceptEmbed.js +0 -4
- package/es/Embed/ImageEmbed.js +1 -4
- package/es/Grid/Grid.js +1 -1
- package/es/LinkBlock/LinkBlock.js +2 -2
- package/es/index.js +1 -1
- package/es/styles.css +28 -36
- package/es/utils/relativeUrl.js +4 -2
- package/lib/Article/Article.d.ts +44 -5
- package/lib/Article/Article.js +153 -46
- package/lib/Article/ArticleByline.d.ts +7 -2
- package/lib/Article/ArticleByline.js +40 -40
- package/lib/Article/ArticleFootNotes.d.ts +2 -2
- package/lib/Article/ArticleFootNotes.js +2 -2
- package/lib/Article/index.d.ts +3 -5
- package/lib/Article/index.js +36 -8
- package/lib/CampaignBlock/CampaignBlock.js +0 -6
- package/lib/Concept/Concept.js +1 -1
- package/lib/ContactBlock/ContactBlock.js +0 -1
- package/lib/Embed/ConceptEmbed.js +0 -4
- package/lib/Embed/ImageEmbed.js +1 -4
- package/lib/Gloss/Gloss.d.ts +1 -3
- package/lib/Grid/Grid.js +1 -1
- package/lib/LinkBlock/LinkBlock.js +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +24 -0
- package/lib/styles.css +28 -36
- package/lib/types.d.ts +1 -1
- package/lib/utils/relativeUrl.js +4 -2
- package/package.json +7 -8
- package/src/Article/Article.tsx +220 -87
- package/src/Article/ArticleByline.stories.tsx +1 -1
- package/src/Article/ArticleByline.tsx +32 -30
- package/src/Article/ArticleFootNotes.tsx +1 -3
- package/src/Article/index.ts +13 -5
- package/src/CampaignBlock/CampaignBlock.tsx +0 -6
- package/src/Concept/Concept.tsx +2 -2
- package/src/ContactBlock/ContactBlock.tsx +0 -3
- package/src/Embed/ConceptEmbed.tsx +1 -5
- package/src/Embed/ImageEmbed.tsx +1 -3
- package/src/Grid/Grid.tsx +1 -1
- package/src/LinkBlock/LinkBlock.tsx +2 -2
- package/src/index.ts +4 -0
- package/src/types.ts +1 -1
- package/src/utils/__tests__/relativeUrl-test.tsx +12 -0
- package/src/utils/relativeUrl.ts +4 -2
- package/es/Article/ArticleContent.js +0 -27
- package/lib/Article/ArticleContent.d.ts +0 -11
- package/lib/Article/ArticleContent.js +0 -33
- package/src/Article/ArticleContent.tsx +0 -21
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
"schemaVersion": "0.44.0",
|
|
3
3
|
"styles": {
|
|
4
4
|
"atomic": [
|
|
5
|
+
"paddingInline]___[value:8%",
|
|
6
|
+
"paddingBlockStart]___[value:xsmall",
|
|
7
|
+
"paddingBlockStart]___[value:medium]___[cond:tablet",
|
|
8
|
+
"paddingBlockStart]___[value:xxlarge]___[cond:desktop",
|
|
9
|
+
"paddingBlockEnd]___[value:xsmall",
|
|
10
|
+
"paddingBlockEnd]___[value:medium]___[cond:tablet",
|
|
11
|
+
"paddingBlockEnd]___[value:xxlarge]___[cond:desktop",
|
|
12
|
+
"background]___[value:surface.default",
|
|
5
13
|
"display]___[value:flex",
|
|
6
14
|
"flexDirection]___[value:column",
|
|
7
15
|
"color]___[value:text.default",
|
|
8
|
-
"gap]___[value:xxlarge",
|
|
9
|
-
"background]___[value:surface.default",
|
|
10
|
-
"paddingBlock]___[value:xsmall",
|
|
11
|
-
"paddingInline]___[value:8%",
|
|
12
16
|
"alignItems]___[value:center",
|
|
13
17
|
"width]___[value:100%",
|
|
14
18
|
"overflowWrap]___[value:break-word",
|
|
15
19
|
"position]___[value:relative",
|
|
16
|
-
"paddingBlock]___[value:medium]___[cond:tablet",
|
|
17
|
-
"paddingBlock]___[value:xxlarge]___[cond:desktop",
|
|
18
20
|
"transform]___[value:scaleY(100) translateY(0.075em)]___[cond:& mjx-stretchy-v > mjx-ext > mjx-c",
|
|
19
21
|
"content]___[value:]___[cond:_after",
|
|
20
22
|
"display]___[value:table]___[cond:_after",
|
|
@@ -28,13 +30,14 @@
|
|
|
28
30
|
"top]___[value:medium]___[cond:tablet",
|
|
29
31
|
"top]___[value:xxlarge]___[cond:desktop",
|
|
30
32
|
"gap]___[value:medium",
|
|
33
|
+
"gap]___[value:xxlarge",
|
|
31
34
|
"marginBlockStart]___[value:medium",
|
|
32
|
-
"paddingBlockStart]___[value:xsmall",
|
|
33
35
|
"borderTop]___[value:1px solid",
|
|
34
36
|
"borderColor]___[value:stroke.subtle",
|
|
35
37
|
"flexDirection]___[value:column-reverse",
|
|
36
38
|
"gap]___[value:3xsmall",
|
|
37
39
|
"justifyContent]___[value:space-between",
|
|
40
|
+
"paddingBlock]___[value:xsmall",
|
|
38
41
|
"textStyle]___[value:body.medium",
|
|
39
42
|
"flexDirection]___[value:row]___[cond:tabletWide",
|
|
40
43
|
"paddingBlockStart]___[value:xxlarge",
|
|
@@ -130,9 +133,6 @@
|
|
|
130
133
|
"textDecoration]___[value:none]___[cond:_hover",
|
|
131
134
|
"textDecoration]___[value:none]___[cond:_focusVisible",
|
|
132
135
|
"display]___[value:none]___[cond:tabletDown",
|
|
133
|
-
"maxWidth]___[value:surface.xsmall",
|
|
134
|
-
"maxWidth]___[value:surface.medium]___[cond:mobileWide",
|
|
135
|
-
"maxWidth]___[value:1100px]___[cond:tabletWide",
|
|
136
136
|
"alignSelf]___[value:center",
|
|
137
137
|
"height]___[value:215px",
|
|
138
138
|
"height]___[value:340px]___[cond:desktop",
|
|
@@ -171,7 +171,6 @@
|
|
|
171
171
|
"opacity]___[value:0.7]___[cond:& .token.namespace",
|
|
172
172
|
"display]___[value:inline",
|
|
173
173
|
"display]___[value:inline]___[cond:& p",
|
|
174
|
-
"maxWidth]___[value:744px",
|
|
175
174
|
"minWidth]___[value:surface.xxsmall",
|
|
176
175
|
"padding]___[value:medium",
|
|
177
176
|
"alignItems]___[value:unset]___[cond:tablet",
|
|
@@ -243,7 +242,6 @@
|
|
|
243
242
|
"width]___[value:100%]___[cond:& iframe",
|
|
244
243
|
"textStyle]___[value:label.xsmall]___[cond:& a",
|
|
245
244
|
"marginInlineStart]___[value:1]___[cond:& a",
|
|
246
|
-
"borderColor]___[value:surface.brand.1.strong",
|
|
247
245
|
"borderBottom]___[value:0",
|
|
248
246
|
"borderBottomLeftRadius]___[value:0",
|
|
249
247
|
"borderBottomRightRadius]___[value:0",
|
package/dist/styles.css
CHANGED
|
@@ -85,28 +85,28 @@
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
.
|
|
89
|
-
|
|
88
|
+
.px_8\% {
|
|
89
|
+
padding-inline: 8%;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
.
|
|
93
|
-
|
|
92
|
+
.pbs_xsmall {
|
|
93
|
+
padding-block-start: var(--spacing-xsmall);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
.
|
|
97
|
-
|
|
96
|
+
.pbe_xsmall {
|
|
97
|
+
padding-block-end: var(--spacing-xsmall);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.bg_surface\.default {
|
|
101
101
|
background: var(--colors-surface-default);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
.
|
|
105
|
-
|
|
104
|
+
.d_flex {
|
|
105
|
+
display: flex;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
.
|
|
109
|
-
|
|
108
|
+
.c_text\.default {
|
|
109
|
+
color: var(--colors-text-default);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
.w_100\% {
|
|
@@ -133,12 +133,12 @@
|
|
|
133
133
|
gap: var(--spacing-medium);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.
|
|
137
|
-
|
|
136
|
+
.gap_xxlarge {
|
|
137
|
+
gap: var(--spacing-xxlarge);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
.
|
|
141
|
-
|
|
140
|
+
.mbs_medium {
|
|
141
|
+
margin-block-start: var(--spacing-medium);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
.bd-t_1px_solid {
|
|
@@ -149,6 +149,10 @@
|
|
|
149
149
|
gap: var(--spacing-3xsmall);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
.py_xsmall {
|
|
153
|
+
padding-block: var(--spacing-xsmall);
|
|
154
|
+
}
|
|
155
|
+
|
|
152
156
|
.pbs_xxlarge {
|
|
153
157
|
padding-block-start: var(--spacing-xxlarge);
|
|
154
158
|
}
|
|
@@ -338,10 +342,6 @@
|
|
|
338
342
|
text-decoration: underline;
|
|
339
343
|
}
|
|
340
344
|
|
|
341
|
-
.max-w_surface\.xsmall {
|
|
342
|
-
max-width: var(--sizes-surface-xsmall);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
345
|
.h_215px {
|
|
346
346
|
height: 215px;
|
|
347
347
|
}
|
|
@@ -366,10 +366,6 @@
|
|
|
366
366
|
display: inline;
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
.max-w_744px {
|
|
370
|
-
max-width: 744px;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
369
|
.min-w_surface\.xxsmall {
|
|
374
370
|
min-width: var(--sizes-surface-xxsmall);
|
|
375
371
|
}
|
|
@@ -722,10 +718,6 @@
|
|
|
722
718
|
background-color: var(--colors-surface-disabled);
|
|
723
719
|
}
|
|
724
720
|
|
|
725
|
-
.bd-c_surface\.brand\.1\.strong {
|
|
726
|
-
border-color: var(--colors-surface-brand-1-strong);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
721
|
.bdr-bl_0 {
|
|
730
722
|
border-bottom-left-radius: 0;
|
|
731
723
|
}
|
|
@@ -1420,9 +1412,6 @@
|
|
|
1420
1412
|
}
|
|
1421
1413
|
|
|
1422
1414
|
@media screen and (min-width: 29.75rem) {
|
|
1423
|
-
.mobileWide\:max-w_surface\.medium {
|
|
1424
|
-
max-width: var(--sizes-surface-medium);
|
|
1425
|
-
}
|
|
1426
1415
|
.mobileWide\:d_none {
|
|
1427
1416
|
display: none;
|
|
1428
1417
|
}
|
|
@@ -1435,8 +1424,11 @@
|
|
|
1435
1424
|
}
|
|
1436
1425
|
|
|
1437
1426
|
@media screen and (min-width: 37.5625rem) {
|
|
1438
|
-
.tablet\:
|
|
1439
|
-
padding-block: var(--spacing-medium);
|
|
1427
|
+
.tablet\:pbs_medium {
|
|
1428
|
+
padding-block-start: var(--spacing-medium);
|
|
1429
|
+
}
|
|
1430
|
+
.tablet\:pbe_medium {
|
|
1431
|
+
padding-block-end: var(--spacing-medium);
|
|
1440
1432
|
}
|
|
1441
1433
|
.tablet\:px_medium {
|
|
1442
1434
|
padding-inline: var(--spacing-medium);
|
|
@@ -1521,9 +1513,6 @@
|
|
|
1521
1513
|
}
|
|
1522
1514
|
.tabletWide\:max-w_532px {
|
|
1523
1515
|
max-width: 532px;
|
|
1524
|
-
}
|
|
1525
|
-
.tabletWide\:max-w_1100px {
|
|
1526
|
-
max-width: 1100px;
|
|
1527
1516
|
}
|
|
1528
1517
|
.tabletWide\:flex-d_row {
|
|
1529
1518
|
flex-direction: row;
|
|
@@ -1534,8 +1523,11 @@
|
|
|
1534
1523
|
}
|
|
1535
1524
|
|
|
1536
1525
|
@media screen and (min-width: 61.3125rem) {
|
|
1537
|
-
.desktop\:
|
|
1538
|
-
padding-block: var(--spacing-xxlarge);
|
|
1526
|
+
.desktop\:pbs_xxlarge {
|
|
1527
|
+
padding-block-start: var(--spacing-xxlarge);
|
|
1528
|
+
}
|
|
1529
|
+
.desktop\:pbe_xxlarge {
|
|
1530
|
+
padding-block-end: var(--spacing-xxlarge);
|
|
1539
1531
|
}
|
|
1540
1532
|
.desktop\:w_260px {
|
|
1541
1533
|
width: 260px;
|
package/es/Article/Article.js
CHANGED
|
@@ -6,31 +6,84 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
|
+
import { ark } from "@ark-ui/react";
|
|
9
11
|
import { Heading, Text } from "@ndla/primitives";
|
|
12
|
+
import { cx } from "@ndla/styled-system/css";
|
|
10
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
|
-
import ArticleByline from "./ArticleByline";
|
|
12
|
-
import { ArticleContent } from "./ArticleContent";
|
|
14
|
+
import { ArticleByline } from "./ArticleByline";
|
|
13
15
|
import { ContentTypeBadgeNew } from "..";
|
|
14
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
|
|
17
|
+
const articlePadding = {
|
|
18
|
+
paddingInline: "8%"
|
|
19
|
+
};
|
|
20
|
+
const paddingBlockEnd = {
|
|
21
|
+
paddingBlockEnd: "xsmall",
|
|
22
|
+
tablet: {
|
|
23
|
+
paddingBlockEnd: "medium"
|
|
24
|
+
},
|
|
25
|
+
desktop: {
|
|
26
|
+
paddingBlockEnd: "xxlarge"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const paddingBlockStart = {
|
|
30
|
+
paddingBlockStart: "xsmall",
|
|
31
|
+
tablet: {
|
|
32
|
+
paddingBlockStart: "medium"
|
|
33
|
+
},
|
|
34
|
+
desktop: {
|
|
35
|
+
paddingBlockStart: "xxlarge"
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export const ArticlePadding = styled(ark.div, {
|
|
39
|
+
base: articlePadding,
|
|
40
|
+
variants: {
|
|
41
|
+
padStart: {
|
|
42
|
+
true: paddingBlockStart
|
|
43
|
+
},
|
|
44
|
+
padEnd: {
|
|
45
|
+
true: paddingBlockEnd
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
baseComponent: true
|
|
50
|
+
});
|
|
51
|
+
const StyledArticleContent = styled(ark.section, {
|
|
52
|
+
base: {
|
|
53
|
+
background: "surface.default"
|
|
54
|
+
},
|
|
55
|
+
variants: {
|
|
56
|
+
padded: {
|
|
57
|
+
true: {
|
|
58
|
+
...articlePadding,
|
|
59
|
+
...paddingBlockStart,
|
|
60
|
+
...paddingBlockEnd
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
baseComponent: true
|
|
66
|
+
});
|
|
67
|
+
export const ArticleContent = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
68
|
+
let {
|
|
69
|
+
className,
|
|
70
|
+
...props
|
|
71
|
+
} = _ref;
|
|
72
|
+
return /*#__PURE__*/_jsx(StyledArticleContent, {
|
|
73
|
+
className: cx("ndla-article", className),
|
|
74
|
+
...props,
|
|
75
|
+
ref: ref
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
const StyledArticleWrapper = styled(ark.article, {
|
|
16
79
|
base: {
|
|
17
80
|
display: "flex",
|
|
18
81
|
flexDirection: "column",
|
|
19
82
|
color: "text.default",
|
|
20
|
-
gap: "xxlarge",
|
|
21
|
-
background: "surface.default",
|
|
22
|
-
paddingBlock: "xsmall",
|
|
23
|
-
paddingInline: "8%",
|
|
24
83
|
alignItems: "center",
|
|
25
84
|
width: "100%",
|
|
26
85
|
overflowWrap: "break-word",
|
|
27
86
|
position: "relative",
|
|
28
|
-
tablet: {
|
|
29
|
-
paddingBlock: "medium"
|
|
30
|
-
},
|
|
31
|
-
desktop: {
|
|
32
|
-
paddingBlock: "xxlarge"
|
|
33
|
-
},
|
|
34
87
|
"& mjx-stretchy-v > mjx-ext > mjx-c": {
|
|
35
88
|
transform: "scaleY(100) translateY(0.075em)"
|
|
36
89
|
},
|
|
@@ -40,8 +93,15 @@ export const ArticleWrapper = styled("article", {
|
|
|
40
93
|
clear: "both"
|
|
41
94
|
}
|
|
42
95
|
}
|
|
96
|
+
}, {
|
|
97
|
+
baseComponent: true
|
|
43
98
|
});
|
|
44
|
-
const
|
|
99
|
+
export const ArticleWrapper = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(StyledArticleWrapper, {
|
|
100
|
+
"data-ndla-article": "",
|
|
101
|
+
ref: ref,
|
|
102
|
+
...props
|
|
103
|
+
}));
|
|
104
|
+
export const ArticleHGroup = styled(ark.hgroup, {
|
|
45
105
|
base: {
|
|
46
106
|
display: "flex",
|
|
47
107
|
width: "100%",
|
|
@@ -52,8 +112,10 @@ const ArticleTitleWrapper = styled("hgroup", {
|
|
|
52
112
|
overflowWrap: "anywhere"
|
|
53
113
|
}
|
|
54
114
|
}
|
|
115
|
+
}, {
|
|
116
|
+
baseComponent: true
|
|
55
117
|
});
|
|
56
|
-
const
|
|
118
|
+
export const ArticleActionWrapper = styled(ark.div, {
|
|
57
119
|
base: {
|
|
58
120
|
position: "absolute",
|
|
59
121
|
right: "8%",
|
|
@@ -65,25 +127,83 @@ const ArticleFavoritesButtonWrapper = styled("div", {
|
|
|
65
127
|
top: "xxlarge"
|
|
66
128
|
}
|
|
67
129
|
}
|
|
130
|
+
}, {
|
|
131
|
+
baseComponent: true
|
|
68
132
|
});
|
|
69
|
-
export const ArticleHeader = styled(
|
|
133
|
+
export const ArticleHeader = styled(ark.header, {
|
|
70
134
|
base: {
|
|
71
135
|
display: "flex",
|
|
72
136
|
flexDirection: "column",
|
|
137
|
+
background: "surface.default",
|
|
73
138
|
gap: "medium",
|
|
74
139
|
alignItems: "flex-start",
|
|
75
140
|
width: "100%"
|
|
141
|
+
},
|
|
142
|
+
variants: {
|
|
143
|
+
padded: {
|
|
144
|
+
true: {
|
|
145
|
+
...articlePadding,
|
|
146
|
+
...paddingBlockStart
|
|
147
|
+
}
|
|
148
|
+
}
|
|
76
149
|
}
|
|
150
|
+
}, {
|
|
151
|
+
baseComponent: true
|
|
77
152
|
});
|
|
78
|
-
export const ArticleFooter = styled(
|
|
153
|
+
export const ArticleFooter = styled(ark.footer, {
|
|
79
154
|
base: {
|
|
80
155
|
display: "flex",
|
|
81
156
|
flexDirection: "column",
|
|
157
|
+
background: "surface.default",
|
|
82
158
|
gap: "xxlarge",
|
|
83
159
|
width: "100%"
|
|
160
|
+
},
|
|
161
|
+
variants: {
|
|
162
|
+
padded: {
|
|
163
|
+
true: {
|
|
164
|
+
...articlePadding,
|
|
165
|
+
...paddingBlockEnd
|
|
166
|
+
}
|
|
167
|
+
}
|
|
84
168
|
}
|
|
169
|
+
}, {
|
|
170
|
+
baseComponent: true
|
|
85
171
|
});
|
|
86
|
-
export const
|
|
172
|
+
export const ArticleTitle = _ref2 => {
|
|
173
|
+
let {
|
|
174
|
+
contentType,
|
|
175
|
+
heartButton,
|
|
176
|
+
title,
|
|
177
|
+
lang,
|
|
178
|
+
id,
|
|
179
|
+
introduction,
|
|
180
|
+
competenceGoals
|
|
181
|
+
} = _ref2;
|
|
182
|
+
return /*#__PURE__*/_jsxs(ArticleHeader, {
|
|
183
|
+
padded: true,
|
|
184
|
+
children: [/*#__PURE__*/_jsxs(ArticleHGroup, {
|
|
185
|
+
children: [!!contentType && /*#__PURE__*/_jsx(ContentTypeBadgeNew, {
|
|
186
|
+
contentType: contentType
|
|
187
|
+
}), !!heartButton && /*#__PURE__*/_jsx(ArticleActionWrapper, {
|
|
188
|
+
children: heartButton
|
|
189
|
+
}), /*#__PURE__*/_jsx(Heading, {
|
|
190
|
+
textStyle: "heading.large",
|
|
191
|
+
id: id,
|
|
192
|
+
lang: lang,
|
|
193
|
+
children: title
|
|
194
|
+
})]
|
|
195
|
+
}), !!introduction && /*#__PURE__*/_jsx(Text, {
|
|
196
|
+
lang: lang,
|
|
197
|
+
textStyle: "body.xlarge",
|
|
198
|
+
asChild: true,
|
|
199
|
+
consumeCss: true,
|
|
200
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
201
|
+
children: introduction
|
|
202
|
+
})
|
|
203
|
+
}), competenceGoals]
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
export const Article = _ref3 => {
|
|
87
207
|
let {
|
|
88
208
|
article,
|
|
89
209
|
contentType,
|
|
@@ -93,7 +213,7 @@ export const Article = _ref => {
|
|
|
93
213
|
id,
|
|
94
214
|
heartButton,
|
|
95
215
|
lang
|
|
96
|
-
} =
|
|
216
|
+
} = _ref3;
|
|
97
217
|
const {
|
|
98
218
|
title,
|
|
99
219
|
introduction,
|
|
@@ -104,32 +224,19 @@ export const Article = _ref => {
|
|
|
104
224
|
} = article;
|
|
105
225
|
const authors = copyright?.creators.length || copyright?.rightsholders.length ? copyright.creators : copyright?.processors;
|
|
106
226
|
return /*#__PURE__*/_jsxs(ArticleWrapper, {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
textStyle: "heading.large",
|
|
116
|
-
id: id,
|
|
117
|
-
tabIndex: -1,
|
|
118
|
-
lang: lang,
|
|
119
|
-
children: title
|
|
120
|
-
})]
|
|
121
|
-
}), !!introduction && /*#__PURE__*/_jsx(Text, {
|
|
122
|
-
lang: lang,
|
|
123
|
-
textStyle: "body.xlarge",
|
|
124
|
-
asChild: true,
|
|
125
|
-
consumeCss: true,
|
|
126
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
127
|
-
children: introduction
|
|
128
|
-
})
|
|
129
|
-
}), competenceGoals]
|
|
227
|
+
children: [/*#__PURE__*/_jsx(ArticleTitle, {
|
|
228
|
+
id: id,
|
|
229
|
+
contentType: contentType,
|
|
230
|
+
heartButton: heartButton,
|
|
231
|
+
title: title,
|
|
232
|
+
introduction: introduction,
|
|
233
|
+
competenceGoals: competenceGoals,
|
|
234
|
+
lang: lang
|
|
130
235
|
}), /*#__PURE__*/_jsx(ArticleContent, {
|
|
236
|
+
padded: true,
|
|
131
237
|
children: content
|
|
132
238
|
}), /*#__PURE__*/_jsxs(ArticleFooter, {
|
|
239
|
+
padded: true,
|
|
133
240
|
children: [/*#__PURE__*/_jsx(ArticleByline, {
|
|
134
241
|
footnotes: footNotes,
|
|
135
242
|
authors: authors,
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { useCallback, useEffect, useState } from "react";
|
|
9
|
+
import { forwardRef, useCallback, useEffect, useState } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
11
|
import { useLocation } from "react-router-dom";
|
|
12
12
|
import { ArrowDownShortLine } from "@ndla/icons/common";
|
|
13
13
|
import { getLicenseByAbbreviation } from "@ndla/licenses";
|
|
14
14
|
import { AccordionItem, AccordionItemContent, AccordionItemIndicator, AccordionItemTrigger, AccordionRoot, Heading } from "@ndla/primitives";
|
|
15
15
|
import { styled } from "@ndla/styled-system/jsx";
|
|
16
|
-
import ArticleFootNotes from "./ArticleFootNotes";
|
|
16
|
+
import { ArticleFootNotes } from "./ArticleFootNotes";
|
|
17
17
|
import { LicenseLink } from "../LicenseByline/LicenseLink";
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
19
|
const Wrapper = styled("div", {
|
|
@@ -86,7 +86,7 @@ const StyledAccordionRoot = styled(AccordionRoot, {
|
|
|
86
86
|
});
|
|
87
87
|
const refRegexp = /note\d/;
|
|
88
88
|
const footnotesAccordionId = "footnotes";
|
|
89
|
-
const ArticleByline = _ref => {
|
|
89
|
+
export const ArticleByline = _ref => {
|
|
90
90
|
let {
|
|
91
91
|
authors = [],
|
|
92
92
|
suppliers = [],
|
|
@@ -145,46 +145,46 @@ const ArticleByline = _ref => {
|
|
|
145
145
|
multiple: true,
|
|
146
146
|
value: openAccordions,
|
|
147
147
|
onValueChange: details => setOpenAccordions(details.value),
|
|
148
|
-
children: [licenseBox && /*#__PURE__*/
|
|
148
|
+
children: [!!licenseBox && /*#__PURE__*/_jsx(ArticleBylineAccordionItem, {
|
|
149
149
|
value: accordionItemValue,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
consumeCss: true,
|
|
154
|
-
textStyle: "label.medium",
|
|
155
|
-
fontWeight: "bold",
|
|
156
|
-
children: /*#__PURE__*/_jsx("h2", {
|
|
157
|
-
children: t("article.useContent")
|
|
158
|
-
})
|
|
159
|
-
}), /*#__PURE__*/_jsx(AccordionItemIndicator, {
|
|
160
|
-
asChild: true,
|
|
161
|
-
children: /*#__PURE__*/_jsx(ArrowDownShortLine, {})
|
|
162
|
-
})]
|
|
163
|
-
}), /*#__PURE__*/_jsx(AccordionItemContent, {
|
|
164
|
-
children: licenseBox
|
|
165
|
-
})]
|
|
166
|
-
}), !!footnotes?.length && /*#__PURE__*/_jsxs(AccordionItem, {
|
|
150
|
+
accordionTitle: t("article.useContent"),
|
|
151
|
+
children: licenseBox
|
|
152
|
+
}), !!footnotes?.length && /*#__PURE__*/_jsx(ArticleBylineAccordionItem, {
|
|
167
153
|
value: footnotesAccordionId,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
textStyle: "label.medium",
|
|
173
|
-
fontWeight: "bold",
|
|
174
|
-
children: /*#__PURE__*/_jsx("h2", {
|
|
175
|
-
children: t("article.footnotes")
|
|
176
|
-
})
|
|
177
|
-
}), /*#__PURE__*/_jsx(AccordionItemIndicator, {
|
|
178
|
-
asChild: true,
|
|
179
|
-
children: /*#__PURE__*/_jsx(ArrowDownShortLine, {})
|
|
180
|
-
})]
|
|
181
|
-
}), /*#__PURE__*/_jsx(AccordionItemContent, {
|
|
182
|
-
children: /*#__PURE__*/_jsx(ArticleFootNotes, {
|
|
183
|
-
footNotes: footnotes
|
|
184
|
-
})
|
|
185
|
-
})]
|
|
154
|
+
accordionTitle: t("article.footnotes"),
|
|
155
|
+
children: /*#__PURE__*/_jsx(ArticleFootNotes, {
|
|
156
|
+
footNotes: footnotes
|
|
157
|
+
})
|
|
186
158
|
})]
|
|
187
159
|
})]
|
|
188
160
|
});
|
|
189
161
|
};
|
|
190
|
-
export
|
|
162
|
+
export const ArticleBylineAccordionItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
163
|
+
let {
|
|
164
|
+
value,
|
|
165
|
+
accordionTitle,
|
|
166
|
+
children,
|
|
167
|
+
...props
|
|
168
|
+
} = _ref2;
|
|
169
|
+
return /*#__PURE__*/_jsxs(AccordionItem, {
|
|
170
|
+
value: value,
|
|
171
|
+
ref: ref,
|
|
172
|
+
...props,
|
|
173
|
+
children: [/*#__PURE__*/_jsxs(AccordionItemTrigger, {
|
|
174
|
+
children: [/*#__PURE__*/_jsx(Heading, {
|
|
175
|
+
asChild: true,
|
|
176
|
+
consumeCss: true,
|
|
177
|
+
textStyle: "label.medium",
|
|
178
|
+
fontWeight: "bold",
|
|
179
|
+
children: /*#__PURE__*/_jsx("h2", {
|
|
180
|
+
children: accordionTitle
|
|
181
|
+
})
|
|
182
|
+
}), /*#__PURE__*/_jsx(AccordionItemIndicator, {
|
|
183
|
+
asChild: true,
|
|
184
|
+
children: /*#__PURE__*/_jsx(ArrowDownShortLine, {})
|
|
185
|
+
})]
|
|
186
|
+
}), /*#__PURE__*/_jsx(AccordionItemContent, {
|
|
187
|
+
children: children
|
|
188
|
+
})]
|
|
189
|
+
});
|
|
190
|
+
});
|
|
@@ -48,7 +48,7 @@ const FootnoteList = styled("ol", {
|
|
|
48
48
|
listStyle: "none"
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
const ArticleFootNotes = _ref2 => {
|
|
51
|
+
export const ArticleFootNotes = _ref2 => {
|
|
52
52
|
let {
|
|
53
53
|
footNotes
|
|
54
54
|
} = _ref2;
|
|
@@ -57,5 +57,4 @@ const ArticleFootNotes = _ref2 => {
|
|
|
57
57
|
footNote: footNote
|
|
58
58
|
}, footNote.ref))
|
|
59
59
|
});
|
|
60
|
-
};
|
|
61
|
-
export default ArticleFootNotes;
|
|
60
|
+
};
|
package/es/Article/index.js
CHANGED
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
export { ArticleContent } from "./ArticleContent";
|
|
13
|
-
export { ArticleByline, ArticleFootNotes };
|
|
9
|
+
export { Article, ArticleWrapper, ArticleHeader, ArticleFooter, ArticleTitle, ArticleActionWrapper, ArticleHGroup, ArticleContent, ArticlePadding } from "./Article";
|
|
10
|
+
export { ArticleByline, ArticleBylineAccordionItem } from "./ArticleByline";
|
|
11
|
+
export { ArticleFootNotes } from "./ArticleFootNotes";
|
|
14
12
|
export { ArticleParagraph } from "./ArticleParagraph";
|
|
@@ -23,14 +23,8 @@ const Container = styled("div", {
|
|
|
23
23
|
borderRadius: "xsmall",
|
|
24
24
|
boxShadow: "full",
|
|
25
25
|
marginBlockEnd: "4xsmall",
|
|
26
|
-
maxWidth: "surface.xsmall",
|
|
27
26
|
overflow: "hidden",
|
|
28
|
-
mobileWide: {
|
|
29
|
-
maxWidth: "surface.medium"
|
|
30
|
-
},
|
|
31
27
|
tabletWide: {
|
|
32
|
-
// TODO: This is probably not the correct max-width. And it should be a token
|
|
33
|
-
maxWidth: "1100px",
|
|
34
28
|
flexDirection: "row"
|
|
35
29
|
}
|
|
36
30
|
}
|
package/es/Concept/Concept.js
CHANGED
|
@@ -29,7 +29,7 @@ const ContentWrapper = styled("div", {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
// TODO: Figure out if we need to support
|
|
32
|
+
// TODO: Figure out if we need to support headerButtons.
|
|
33
33
|
|
|
34
34
|
export const Concept = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
35
35
|
let {
|
package/es/Embed/ConceptEmbed.js
CHANGED
|
@@ -69,10 +69,6 @@ export const ConceptEmbed = _ref => {
|
|
|
69
69
|
children: parsedContent
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
-
// TODO: Consider if we should make this act like the old concept popover.
|
|
73
|
-
// Should it take up the entire screen height on mobile? I don't think we need to.
|
|
74
|
-
// Should it always stay directly underneath the trigger?
|
|
75
|
-
|
|
76
72
|
export const InlineConcept = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
77
73
|
let {
|
|
78
74
|
linkText,
|
package/es/Embed/ImageEmbed.js
CHANGED
|
@@ -93,8 +93,7 @@ const ImageWrapper = styled("div", {
|
|
|
93
93
|
border: {
|
|
94
94
|
true: {
|
|
95
95
|
border: "1px solid",
|
|
96
|
-
|
|
97
|
-
borderColor: "surface.brand.1.strong",
|
|
96
|
+
borderColor: "stroke.subtle",
|
|
98
97
|
borderBottom: "0",
|
|
99
98
|
borderRadius: "xsmall",
|
|
100
99
|
borderBottomLeftRadius: "0",
|
|
@@ -127,8 +126,6 @@ const StyledFigure = styled(Figure, {
|
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
128
|
});
|
|
130
|
-
|
|
131
|
-
// TODO: Ask about BylineButton styling. Not included in design
|
|
132
129
|
const BylineButton = styled("button", {
|
|
133
130
|
base: {
|
|
134
131
|
cursor: "pointer",
|