@ndla/ui 55.0.14-alpha.0 → 55.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.
Files changed (82) hide show
  1. package/dist/panda.buildinfo.json +40 -13
  2. package/dist/styles.css +160 -54
  3. package/es/Article/ArticleByline.js +81 -48
  4. package/es/Article/ArticleFootNotes.js +31 -19
  5. package/es/AudioPlayer/AudioPlayer.js +1 -0
  6. package/es/Concept/Concept.js +2 -2
  7. package/es/ContactBlock/ContactBlock.js +17 -17
  8. package/es/ContentTypeBadge/ContentTypeBadgeNew.js +1 -0
  9. package/es/Embed/BrightcoveEmbed.js +0 -1
  10. package/es/Embed/CopyrightEmbed.js +1 -2
  11. package/es/FrontpageArticle/FrontpageArticle.js +1 -2
  12. package/es/LicenseByline/EmbedByline.js +143 -33
  13. package/es/LicenseByline/LicenseLink.js +16 -9
  14. package/es/LicenseByline/index.js +2 -2
  15. package/es/index.js +0 -2
  16. package/es/model/ContentType.js +3 -1
  17. package/es/styles.css +160 -54
  18. package/lib/Article/ArticleByline.d.ts +1 -3
  19. package/lib/Article/ArticleByline.js +84 -51
  20. package/lib/Article/ArticleFootNotes.js +31 -20
  21. package/lib/AudioPlayer/AudioPlayer.js +1 -0
  22. package/lib/Concept/Concept.js +1 -1
  23. package/lib/ContactBlock/ContactBlock.js +18 -18
  24. package/lib/ContentTypeBadge/ContentTypeBadgeNew.d.ts +1 -2
  25. package/lib/ContentTypeBadge/ContentTypeBadgeNew.js +1 -0
  26. package/lib/Embed/BrightcoveEmbed.js +0 -1
  27. package/lib/Embed/CopyrightEmbed.js +1 -2
  28. package/lib/FrontpageArticle/FrontpageArticle.js +1 -2
  29. package/lib/LicenseByline/EmbedByline.d.ts +2 -4
  30. package/lib/LicenseByline/EmbedByline.js +145 -35
  31. package/lib/LicenseByline/LicenseLink.d.ts +2 -2
  32. package/lib/LicenseByline/LicenseLink.js +16 -9
  33. package/lib/LicenseByline/index.d.ts +2 -2
  34. package/lib/LicenseByline/index.js +4 -5
  35. package/lib/index.d.ts +0 -2
  36. package/lib/index.js +0 -20
  37. package/lib/model/ContentType.d.ts +1 -0
  38. package/lib/model/ContentType.js +4 -2
  39. package/lib/styles.css +160 -54
  40. package/package.json +5 -6
  41. package/src/Article/ArticleByline.tsx +83 -70
  42. package/src/Article/ArticleFootNotes.tsx +32 -36
  43. package/src/AudioPlayer/AudioPlayer.tsx +1 -0
  44. package/src/Concept/Concept.tsx +2 -2
  45. package/src/ContactBlock/ContactBlock.tsx +1 -1
  46. package/src/ContentTypeBadge/ContentTypeBadgeNew.tsx +3 -1
  47. package/src/Embed/BrightcoveEmbed.tsx +1 -1
  48. package/src/Embed/CopyrightEmbed.tsx +1 -1
  49. package/src/FrontpageArticle/FrontpageArticle.tsx +1 -1
  50. package/src/LicenseByline/EmbedByline.stories.tsx +9 -4
  51. package/src/LicenseByline/EmbedByline.tsx +139 -53
  52. package/src/LicenseByline/LicenseLink.tsx +15 -15
  53. package/src/LicenseByline/index.tsx +2 -2
  54. package/src/index.ts +0 -3
  55. package/src/model/ContentType.ts +2 -0
  56. package/es/CreatedBy/CreatedBy.js +0 -73
  57. package/es/CreatedBy/index.js +0 -10
  58. package/es/LicenseByline/LicenseDescription.js +0 -63
  59. package/es/List/OrderedList.js +0 -41
  60. package/es/List/UnOrderedList.js +0 -28
  61. package/es/List/index.js +0 -10
  62. package/lib/CreatedBy/CreatedBy.d.ts +0 -15
  63. package/lib/CreatedBy/CreatedBy.js +0 -78
  64. package/lib/CreatedBy/index.d.ts +0 -9
  65. package/lib/CreatedBy/index.js +0 -16
  66. package/lib/LicenseByline/LicenseDescription.d.ts +0 -15
  67. package/lib/LicenseByline/LicenseDescription.js +0 -70
  68. package/lib/List/OrderedList.d.ts +0 -16
  69. package/lib/List/OrderedList.js +0 -48
  70. package/lib/List/UnOrderedList.d.ts +0 -10
  71. package/lib/List/UnOrderedList.js +0 -35
  72. package/lib/List/index.d.ts +0 -9
  73. package/lib/List/index.js +0 -20
  74. package/src/CreatedBy/CreatedBy.stories.tsx +0 -36
  75. package/src/CreatedBy/CreatedBy.tsx +0 -63
  76. package/src/CreatedBy/index.ts +0 -11
  77. package/src/LicenseByline/LicenseDescription.tsx +0 -100
  78. package/src/List/OrderedList.stories.tsx +0 -135
  79. package/src/List/OrderedList.tsx +0 -158
  80. package/src/List/UnOrderedList.tsx +0 -43
  81. package/src/List/UnorderedList.stories.tsx +0 -72
  82. package/src/List/index.ts +0 -10
package/lib/styles.css CHANGED
@@ -1,5 +1,17 @@
1
1
  @layer utilities {
2
2
  @layer compositions {
3
+ .textStyle_body\.medium {
4
+ font-family: var(--fonts-sans);
5
+ font-weight: var(--font-weights-normal);
6
+ font-size: var(--font-sizes-small);
7
+ line-height: var(--line-heights-small);
8
+ }
9
+
10
+ .textStyle_body\.medium:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
11
+ font-size: calc(var(--font-sizes-small) * 1.11);
12
+ line-height: calc(var(--line-heights-small) * 1.11);
13
+ }
14
+
3
15
  .textStyle_body\.large {
4
16
  font-family: var(--fonts-sans);
5
17
  font-weight: var(--font-weights-normal);
@@ -36,18 +48,6 @@
36
48
  line-height: calc(var(--line-heights-medium) * 1.11);
37
49
  }
38
50
 
39
- .textStyle_body\.medium {
40
- font-family: var(--fonts-sans);
41
- font-weight: var(--font-weights-normal);
42
- font-size: var(--font-sizes-small);
43
- line-height: var(--line-heights-small);
44
- }
45
-
46
- .textStyle_body\.medium:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
47
- font-size: calc(var(--font-sizes-small) * 1.11);
48
- line-height: calc(var(--line-heights-small) * 1.11);
49
- }
50
-
51
51
  .\[\&_a\]\:textStyle_label\.xsmall a {
52
52
  font-family: var(--fonts-sans);
53
53
  font-weight: var(--font-weights-normal);
@@ -61,6 +61,50 @@
61
61
  }
62
62
  }
63
63
 
64
+ .mbs_medium {
65
+ margin-block-start: var(--spacing-medium);
66
+ }
67
+
68
+ .pbs_xsmall {
69
+ padding-block-start: var(--spacing-xsmall);
70
+ }
71
+
72
+ .bd-t_1px_solid {
73
+ border-top: 1px solid;
74
+ }
75
+
76
+ .d_flex {
77
+ display: flex;
78
+ }
79
+
80
+ .gap_3xsmall {
81
+ gap: var(--spacing-3xsmall);
82
+ }
83
+
84
+ .w_100\% {
85
+ width: 100%;
86
+ }
87
+
88
+ .py_xsmall {
89
+ padding-block: var(--spacing-xsmall);
90
+ }
91
+
92
+ .gap_xsmall {
93
+ gap: var(--spacing-xsmall);
94
+ }
95
+
96
+ .pbs_xxlarge {
97
+ padding-block-start: var(--spacing-xxlarge);
98
+ }
99
+
100
+ .gap_medium {
101
+ gap: var(--spacing-medium);
102
+ }
103
+
104
+ .li-s_none {
105
+ list-style: none;
106
+ }
107
+
64
108
  .bd_1px_solid {
65
109
  border: 1px solid;
66
110
  }
@@ -73,12 +117,12 @@
73
117
  box-shadow: var(--shadows-full);
74
118
  }
75
119
 
76
- .ov_hidden {
77
- overflow: hidden;
120
+ .mbe_4xsmall {
121
+ margin-block-end: var(--spacing-4xsmall);
78
122
  }
79
123
 
80
- .d_flex {
81
- display: flex;
124
+ .ov_hidden {
125
+ overflow: hidden;
82
126
  }
83
127
 
84
128
  .flex_1_0_auto {
@@ -93,18 +137,10 @@
93
137
  height: var(--sizes-surface-4xsmall);
94
138
  }
95
139
 
96
- .gap_xsmall {
97
- gap: var(--spacing-xsmall);
98
- }
99
-
100
140
  .p_xsmall {
101
141
  padding: var(--spacing-xsmall);
102
142
  }
103
143
 
104
- .w_100\% {
105
- width: 100%;
106
- }
107
-
108
144
  .bd-bs_1px_solid {
109
145
  border-block-start: 1px solid;
110
146
  }
@@ -130,10 +166,6 @@
130
166
  background: var(--colors-background-default);
131
167
  }
132
168
 
133
- .py_xsmall {
134
- padding-block: var(--spacing-xsmall);
135
- }
136
-
137
169
  .px_medium {
138
170
  padding-inline: var(--spacing-medium);
139
171
  }
@@ -210,10 +242,6 @@
210
242
  color: var(--colors-text-default);
211
243
  }
212
244
 
213
- .gap_medium {
214
- gap: var(--spacing-medium);
215
- }
216
-
217
245
  .h_100\% {
218
246
  height: 100%;
219
247
  }
@@ -407,20 +435,32 @@
407
435
  padding-block: var(--spacing-small);
408
436
  }
409
437
 
410
- .bd-t_1px_solid {
411
- border-top: 1px solid;
412
- }
413
-
414
438
  .bg_surface\.default {
415
439
  background: var(--colors-surface-default);
416
440
  }
417
441
 
418
- .c_icon\.strong {
419
- color: var(--colors-icon-strong);
442
+ .bg_surface\.dangerSubtle {
443
+ background: var(--colors-surface-danger-subtle);
420
444
  }
421
445
 
422
- .li-s_none {
423
- list-style: none;
446
+ .d_inline-flex {
447
+ display: inline-flex;
448
+ }
449
+
450
+ .white-space_pre-wrap {
451
+ white-space: pre-wrap;
452
+ }
453
+
454
+ .c_primary {
455
+ color: var(--colors-primary);
456
+ }
457
+
458
+ .white-space_nowrap {
459
+ white-space: nowrap;
460
+ }
461
+
462
+ .c_icon\.strong {
463
+ color: var(--colors-icon-strong);
424
464
  }
425
465
 
426
466
  .d_grid {
@@ -435,22 +475,34 @@
435
475
  aspect-ratio: 1/1;
436
476
  }
437
477
 
438
- .bd-c_stroke\.default {
439
- border-color: var(--colors-stroke-default);
478
+ .bd-c_stroke\.subtle {
479
+ border-color: var(--colors-stroke-subtle);
440
480
  }
441
481
 
442
- .ai_center {
443
- align-items: center;
482
+ .flex-d_column-reverse {
483
+ flex-direction: column-reverse;
444
484
  }
445
485
 
446
- .ai_flex-start {
447
- align-items: flex-start;
486
+ .jc_space-between {
487
+ justify-content: space-between;
488
+ }
489
+
490
+ .ai_center {
491
+ align-items: center;
448
492
  }
449
493
 
450
494
  .flex-d_column {
451
495
  flex-direction: column;
452
496
  }
453
497
 
498
+ .bd-c_stroke\.default {
499
+ border-color: var(--colors-stroke-default);
500
+ }
501
+
502
+ .ai_flex-start {
503
+ align-items: flex-start;
504
+ }
505
+
454
506
  .as_flex-start {
455
507
  align-self: flex-start;
456
508
  }
@@ -463,10 +515,6 @@
463
515
  background-color: var(--colors-background-default);
464
516
  }
465
517
 
466
- .bd-c_stroke\.subtle {
467
- border-color: var(--colors-stroke-subtle);
468
- }
469
-
470
518
  .trs-dur_fast {
471
519
  --transition-duration: var(--durations-fast);
472
520
  transition-duration: var(--durations-fast);
@@ -596,14 +644,14 @@
596
644
  bottom: calc(var(--spacing-medium) * -1);
597
645
  }
598
646
 
599
- .jc_space-between {
600
- justify-content: space-between;
601
- }
602
-
603
647
  .font-style_italic {
604
648
  font-style: italic;
605
649
  }
606
650
 
651
+ .bd-c_stroke\.error {
652
+ border-color: var(--colors-stroke-error);
653
+ }
654
+
607
655
  .grid-tc_repeat\(2\,_1fr\) {
608
656
  grid-template-columns: repeat(2, 1fr);
609
657
  }
@@ -926,6 +974,10 @@
926
974
  content: "";
927
975
  }
928
976
 
977
+ .focusWithin\:td_none:focus-within {
978
+ text-decoration: none;
979
+ }
980
+
929
981
  .focusVisible\:ring_none:is(:focus-visible, [data-focus-visible]) {
930
982
  outline: 2px solid transparent;
931
983
  outline-offset: 2px;
@@ -1042,6 +1094,9 @@
1042
1094
  @media screen and (min-width: 29.75rem) {
1043
1095
  .mobileWide\:max-w_surface\.medium {
1044
1096
  max-width: var(--sizes-surface-medium);
1097
+ }
1098
+ .mobileWide\:d_none {
1099
+ display: none;
1045
1100
  }
1046
1101
  }
1047
1102
 
@@ -1157,8 +1212,59 @@
1157
1212
  }
1158
1213
 
1159
1214
  @media screen and (max-width: 29.7475rem) {
1215
+ .mobileWideDown\:d_grid {
1216
+ display: grid;
1217
+ }
1218
+ .mobileWideDown\:ov_hidden {
1219
+ overflow: hidden;
1220
+ }
1221
+ .mobileWideDown\:white-space_nowrap {
1222
+ white-space: nowrap;
1223
+ }
1224
+ .mobileWideDown\:max-h_large {
1225
+ max-height: var(--sizes-large);
1226
+ }
1227
+ .mobileWideDown\:tov_ellipsis {
1228
+ text-overflow: ellipsis;
1229
+ }
1160
1230
  .mobileWideDown\:cg_3xsmall {
1161
1231
  column-gap: var(--spacing-3xsmall);
1232
+ }
1233
+ .mobileWideDown\:grid-tc_1fr_auto {
1234
+ grid-template-columns: 1fr auto;
1235
+ }
1236
+ .mobileWideDown\:ai_center {
1237
+ align-items: center;
1238
+ }
1239
+ .mobileWideDown\:trs-prop_max-height {
1240
+ --transition-prop: max-height;
1241
+ transition-property: max-height;
1242
+ }
1243
+ .mobileWideDown\:trs-dur_slow {
1244
+ --transition-duration: var(--durations-slow);
1245
+ transition-duration: var(--durations-slow);
1246
+ }
1247
+ .mobileWideDown\:trs-tmf_ease-in {
1248
+ --transition-easing: ease-in;
1249
+ transition-timing-function: ease-in;
1250
+ }
1251
+ }
1252
+
1253
+ @media screen and (max-width: 29.7475rem) {
1254
+ .mobileWideDown\:open\:d_inline:is([open], [data-open], [data-state="open"]) {
1255
+ display: inline;
1256
+ }
1257
+ }
1258
+
1259
+ @media screen and (max-width: 29.7475rem) {
1260
+ .mobileWideDown\:open\:white-space_pre-wrap:is([open], [data-open], [data-state="open"]) {
1261
+ white-space: pre-wrap;
1262
+ }
1263
+ }
1264
+
1265
+ @media screen and (max-width: 29.7475rem) {
1266
+ .mobileWideDown\:open\:max-h_none:is([open], [data-open], [data-state="open"]) {
1267
+ max-height: none;
1162
1268
  }
1163
1269
  }
1164
1270
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "55.0.14-alpha.0",
3
+ "version": "55.0.16-alpha.0",
4
4
  "description": "UI component library for NDLA",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -33,17 +33,16 @@
33
33
  "types"
34
34
  ],
35
35
  "dependencies": {
36
- "@ndla/accordion": "^5.0.7-alpha.0",
37
36
  "@ndla/button": "^14.0.7-alpha.0",
38
37
  "@ndla/core": "^5.0.1",
39
38
  "@ndla/dropdown-menu": "^1.0.38",
40
- "@ndla/forms": "^9.0.7-alpha.0",
39
+ "@ndla/forms": "^9.0.8-alpha.0",
41
40
  "@ndla/hooks": "^2.1.8",
42
41
  "@ndla/icons": "^7.0.8-alpha.0",
43
42
  "@ndla/licenses": "^8.0.0-alpha.0",
44
43
  "@ndla/modal": "^7.0.7-alpha.0",
45
- "@ndla/primitives": "^0.0.18",
46
- "@ndla/safelink": "^6.0.1-alpha.0",
44
+ "@ndla/primitives": "^0.0.19",
45
+ "@ndla/safelink": "^6.0.2-alpha.0",
47
46
  "@ndla/styled-system": "^0.0.8",
48
47
  "@ndla/tooltip": "^8.0.1",
49
48
  "@ndla/typography": "^0.4.23",
@@ -79,5 +78,5 @@
79
78
  "publishConfig": {
80
79
  "access": "public"
81
80
  },
82
- "gitHead": "6fdfbed9f18bbd725c837fb74de2f093e80d5605"
81
+ "gitHead": "b05b7016560891b2867811c4420041e6932003cc"
83
82
  }
@@ -10,44 +10,54 @@ import { TFunction } from "i18next";
10
10
  import { ReactNode, useCallback, useEffect, useState } from "react";
11
11
  import { useTranslation } from "react-i18next";
12
12
  import { useLocation } from "react-router-dom";
13
- import styled from "@emotion/styled";
14
- import { AccordionRoot, AccordionHeader, AccordionContent, AccordionItem } from "@ndla/accordion";
15
- import { breakpoints, colors, fonts, mq, spacing } from "@ndla/core";
13
+ import { ChevronDown } from "@ndla/icons/common";
16
14
  import { getLicenseByAbbreviation } from "@ndla/licenses";
15
+ import {
16
+ AccordionItem,
17
+ AccordionItemContent,
18
+ AccordionItemIndicator,
19
+ AccordionItemTrigger,
20
+ AccordionRoot,
21
+ Heading,
22
+ } from "@ndla/primitives";
23
+ import { styled } from "@ndla/styled-system/jsx";
17
24
  import ArticleFootNotes from "./ArticleFootNotes";
18
- import LicenseLink from "../LicenseByline/LicenseLink";
25
+ import { LicenseLink } from "../LicenseByline/LicenseLink";
19
26
  import { FootNote } from "../types";
20
27
 
21
- const Wrapper = styled.div`
22
- margin-top: ${spacing.normal};
23
- padding-top: ${spacing.normal};
24
- padding-bottom: ${spacing.xsmall};
25
- border-top: 1px solid ${colors.brand.greyLight};
26
- ${fonts.sizes("16px", "24px")};
27
- font-family: ${fonts.sans};
28
- color: ${colors.brand.greyDark};
29
- `;
30
-
31
- const TextWrapper = styled.div`
32
- display: flex;
33
- justify-content: space-between;
34
- width: 100%;
35
- padding-bottom: ${spacing.mediumlarge};
36
- ${mq.range({ until: breakpoints.tabletWide })} {
37
- flex-direction: column;
38
- flex-direction: column-reverse;
39
- gap: ${spacing.xsmall};
40
- }
41
- &[data-learning-path="true"] {
42
- flex-direction: column;
43
- flex-direction: column-reverse;
44
- gap: ${spacing.xsmall};
45
- }
46
- `;
47
-
48
- const PrimaryContributorsWrapper = styled.span`
49
- margin-left: ${spacing.xxsmall};
50
- `;
28
+ const Wrapper = styled("div", {
29
+ base: {
30
+ // TODO: Figure out if we want to remove this margin. It's only here to add some gap between the article content and the byline.
31
+ marginBlockStart: "medium",
32
+ paddingBlockStart: "xsmall",
33
+ borderTop: "1px solid",
34
+ borderColor: "stroke.subtle",
35
+ },
36
+ });
37
+
38
+ // TODO: This is designed with 24px of inline padding. If you do this, most bylines will break into two lines.
39
+ // Should reconsider.
40
+ const TextWrapper = styled("div", {
41
+ base: {
42
+ display: "flex",
43
+ flexDirection: "column-reverse",
44
+ gap: "3xsmall",
45
+ width: "100%",
46
+ justifyContent: "space-between",
47
+ paddingBlock: "xsmall",
48
+ textStyle: "body.medium",
49
+ },
50
+ variants: {
51
+ learningpath: {
52
+ true: {},
53
+ false: {
54
+ tabletWide: {
55
+ flexDirection: "row",
56
+ },
57
+ },
58
+ },
59
+ },
60
+ });
51
61
 
52
62
  type AuthorProps = {
53
63
  name: string;
@@ -57,8 +67,6 @@ type SupplierProps = {
57
67
  name: string;
58
68
  };
59
69
 
60
- type AccordionHeaderVariants = "white" | "blue";
61
-
62
70
  type Props = {
63
71
  authors?: AuthorProps[];
64
72
  suppliers?: SupplierProps[];
@@ -67,7 +75,6 @@ type Props = {
67
75
  licenseBox?: ReactNode;
68
76
  locale?: string;
69
77
  footnotes?: FootNote[];
70
- accordionHeaderVariant?: AccordionHeaderVariants;
71
78
  displayByline?: boolean;
72
79
  bylineType?: "article" | "learningPath";
73
80
  };
@@ -96,27 +103,18 @@ const getSuppliersText = (suppliers: SupplierProps[], t: TFunction) => {
96
103
  });
97
104
  };
98
105
 
99
- const LicenseWrapper = styled.div`
100
- display: flex;
101
- gap: ${spacing.small};
102
- padding-right: ${spacing.xsmall};
103
- `;
106
+ const LicenseWrapper = styled("div", {
107
+ base: {
108
+ display: "flex",
109
+ gap: "xsmall",
110
+ },
111
+ });
104
112
 
105
- const StyledAccordionHeader = styled(AccordionHeader)`
106
- background-color: ${colors.brand.lightest};
107
- ${fonts.sizes("16px", "29px")};
108
- font-weight: ${fonts.weight.semibold};
109
-
110
- &[data-background-color="white"][data-state="closed"] {
111
- background-color: ${colors.background.default};
112
- }
113
- `;
114
-
115
- const StyledAccordionContent = styled(AccordionContent)`
116
- &[data-background-color="white"] {
117
- background-color: ${colors.background.default};
118
- }
119
- `;
113
+ const StyledAccordionRoot = styled(AccordionRoot, {
114
+ base: {
115
+ paddingBlockStart: "xxlarge",
116
+ },
117
+ });
120
118
 
121
119
  const refRegexp = /note\d/;
122
120
  const footnotesAccordionId = "footnotes";
@@ -129,7 +127,6 @@ const ArticleByline = ({
129
127
  licenseBox,
130
128
  published,
131
129
  locale,
132
- accordionHeaderVariant = "blue",
133
130
  displayByline = true,
134
131
  bylineType = "article",
135
132
  }: Props) => {
@@ -167,18 +164,18 @@ const ArticleByline = ({
167
164
  return (
168
165
  <Wrapper>
169
166
  {displayByline && (
170
- <TextWrapper data-learning-path={bylineType === "learningPath"}>
167
+ <TextWrapper learningpath={bylineType === "learningPath"}>
171
168
  <LicenseWrapper>
172
169
  {license && <LicenseLink license={license} />}
173
170
  {showPrimaryContributors && (
174
- <PrimaryContributorsWrapper>
171
+ <span>
175
172
  {authors.length > 0 &&
176
173
  `${t("article.authorsLabel", {
177
174
  names: renderContributors(authors, t),
178
175
  interpolation: { escapeValue: false },
179
176
  })}. `}
180
177
  {getSuppliersText(suppliers, t)}
181
- </PrimaryContributorsWrapper>
178
+ </span>
182
179
  )}
183
180
  </LicenseWrapper>
184
181
  <div>
@@ -186,25 +183,41 @@ const ArticleByline = ({
186
183
  </div>
187
184
  </TextWrapper>
188
185
  )}
189
- <AccordionRoot type="multiple" onValueChange={setOpenAccordions} value={openAccordions}>
186
+ <StyledAccordionRoot
187
+ multiple
188
+ value={openAccordions}
189
+ onValueChange={(details) => setOpenAccordions(details.value)}
190
+ >
190
191
  {licenseBox && (
191
192
  <AccordionItem value={accordionItemValue}>
192
- <StyledAccordionHeader headingLevel="h2" data-background-color={accordionHeaderVariant}>
193
- {t("article.useContent")}
194
- </StyledAccordionHeader>
195
- <StyledAccordionContent data-background-color={accordionHeaderVariant}>{licenseBox}</StyledAccordionContent>
193
+ <AccordionItemTrigger>
194
+ <Heading asChild consumeCss textStyle="label.medium" fontWeight="bold">
195
+ <h2>{t("article.useContent")}</h2>
196
+ </Heading>
197
+ <AccordionItemIndicator asChild>
198
+ <ChevronDown />
199
+ </AccordionItemIndicator>
200
+ </AccordionItemTrigger>
201
+ <AccordionItemContent>{licenseBox}</AccordionItemContent>
196
202
  </AccordionItem>
197
203
  )}
198
204
 
199
205
  {!!footnotes?.length && (
200
206
  <AccordionItem value={footnotesAccordionId}>
201
- <StyledAccordionHeader headingLevel="h2">{t("article.footnotes")}</StyledAccordionHeader>
202
- <StyledAccordionContent forceMount data-background-color={accordionHeaderVariant}>
207
+ <AccordionItemTrigger>
208
+ <Heading asChild consumeCss textStyle="label.medium" fontWeight="bold">
209
+ <h2>{t("article.footnotes")}</h2>
210
+ </Heading>
211
+ <AccordionItemIndicator asChild>
212
+ <ChevronDown />
213
+ </AccordionItemIndicator>
214
+ </AccordionItemTrigger>
215
+ <AccordionItemContent>
203
216
  <ArticleFootNotes footNotes={footnotes} />
204
- </StyledAccordionContent>
217
+ </AccordionItemContent>
205
218
  </AccordionItem>
206
219
  )}
207
- </AccordionRoot>
220
+ </StyledAccordionRoot>
208
221
  </Wrapper>
209
222
  );
210
223
  };
@@ -6,8 +6,8 @@
6
6
  *
7
7
  */
8
8
 
9
- import styled from "@emotion/styled";
10
- import { colors, spacing } from "@ndla/core";
9
+ import { Text } from "@ndla/primitives";
10
+ import { styled } from "@ndla/styled-system/jsx";
11
11
  import { FootNote as FootNoteType } from "../types";
12
12
 
13
13
  const citeDetailString = (description: string | undefined) => (description ? `${description}. ` : "");
@@ -16,36 +16,32 @@ type FootNoteProps = {
16
16
  footNote: FootNoteType;
17
17
  };
18
18
 
19
- const Cite = styled.cite`
20
- display: flex;
21
- gap: ${spacing.small};
22
- a {
23
- box-shadow: none;
24
- text-decoration: underline;
25
- text-underline-offset: ${spacing.xxsmall};
26
- &:hover,
27
- &:focus-visible {
28
- text-decoration: none;
29
- }
30
- }
31
- `;
19
+ const StyledCite = styled("cite", {
20
+ base: {
21
+ display: "flex",
22
+ alignItems: "center",
23
+ gap: "xsmall",
24
+ },
25
+ });
32
26
 
33
27
  const FootNote = ({ footNote }: FootNoteProps) => (
34
28
  <li>
35
- <Cite id={`note${footNote.ref}`}>
36
- <a href={`#ref${footNote.ref}`} target="_self">
37
- {footNote.ref}
38
- </a>
39
- {`«${footNote.title}». ${footNote.authors.join(" ")}. ${citeDetailString(footNote.edition)}${citeDetailString(
40
- footNote.publisher,
41
- )}${footNote.year}. `}
42
- {footNote.url ? (
43
- <a href={footNote.url}>
44
- {footNote.url}
45
- {"."}
29
+ <Text id={`note${footNote.ref}`} asChild consumeCss textStyle="body.medium">
30
+ <StyledCite>
31
+ <a href={`#ref${footNote.ref}`} target="_self">
32
+ {footNote.ref}
46
33
  </a>
47
- ) : null}
48
- </Cite>
34
+ {`«${footNote.title}». ${footNote.authors.join(" ")}. ${citeDetailString(footNote.edition)}${citeDetailString(
35
+ footNote.publisher,
36
+ )}${footNote.year}. `}
37
+ {footNote.url ? (
38
+ <a href={footNote.url}>
39
+ {footNote.url}
40
+ {"."}
41
+ </a>
42
+ ) : null}
43
+ </StyledCite>
44
+ </Text>
49
45
  </li>
50
46
  );
51
47
 
@@ -53,14 +49,14 @@ type ArticleFootNotesProps = {
53
49
  footNotes: Array<FootNoteType>;
54
50
  };
55
51
 
56
- const FootnoteList = styled.ol`
57
- margin: 0;
58
- display: flex;
59
- flex-direction: column;
60
- list-style: none;
61
- padding: ${spacing.small};
62
- color: ${colors.text.light};
63
- `;
52
+ const FootnoteList = styled("ol", {
53
+ base: {
54
+ display: "flex",
55
+ flexDirection: "column",
56
+ gap: "medium",
57
+ listStyle: "none",
58
+ },
59
+ });
64
60
 
65
61
  const ArticleFootNotes = ({ footNotes }: ArticleFootNotesProps) => (
66
62
  <FootnoteList>
@@ -22,6 +22,7 @@ const AudioPlayerWrapper = styled("div", {
22
22
  borderColor: "stroke.default",
23
23
  borderRadius: "xsmall",
24
24
  boxShadow: "full",
25
+ marginBlockEnd: "4xsmall",
25
26
  overflow: "hidden",
26
27
  },
27
28
  });