@ndla/ui 56.0.98-alpha.0 → 56.0.100-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.
@@ -86,7 +86,8 @@ export const ArticleByline = _ref => {
86
86
  licenseBox,
87
87
  published,
88
88
  displayByline = true,
89
- bylineType = "article"
89
+ bylineType = "article",
90
+ bylineSuffix
90
91
  } = _ref;
91
92
  const {
92
93
  t
@@ -113,11 +114,12 @@ export const ArticleByline = _ref => {
113
114
  return () => window.removeEventListener("hashchange", onHashChange);
114
115
  }, [onHashChange]);
115
116
  const showPrimaryContributors = suppliers.length > 0 || authors.length > 0;
117
+ const isLearningpath = bylineType === "learningPath";
116
118
  return /*#__PURE__*/_jsxs(Wrapper, {
117
119
  children: [!!displayByline && /*#__PURE__*/_jsxs(TextWrapper, {
118
- learningpath: bylineType === "learningPath",
120
+ learningpath: isLearningpath,
119
121
  children: [!!showPrimaryContributors && /*#__PURE__*/_jsxs("span", {
120
- children: [authors.length > 0 && `${t("article.authorsLabel", {
122
+ children: [authors.length > 0 && `${t(isLearningpath ? "article.authorsLabelLearningpath" : "article.authorsLabel", {
121
123
  names: renderContributors(authors, t),
122
124
  interpolation: {
123
125
  escapeValue: false
@@ -126,7 +128,7 @@ export const ArticleByline = _ref => {
126
128
  }), published ? /*#__PURE__*/_jsxs("div", {
127
129
  "data-contributors": showPrimaryContributors,
128
130
  children: [t(`${bylineType}.lastUpdated`), " ", published]
129
- }) : null]
131
+ }) : null, bylineSuffix]
130
132
  }), (!!licenseBox || !!footnotes?.length) && /*#__PURE__*/_jsxs(StyledAccordionRoot, {
131
133
  multiple: true,
132
134
  value: openAccordions,
@@ -299,6 +299,7 @@ const messages = {
299
299
  urlAuthorLabel: "Read more about {{name}}",
300
300
  multipleAuthorsLabelAbbreviation: "et al.",
301
301
  authorsLabel: "Written by: {{names}}",
302
+ authorsLabelLearningpath: "Made by {{names}}",
302
303
  multipleAuthorsLabelAriaConjunction: "and",
303
304
  copyPageLink: "Copy page-link",
304
305
  copyPageLinkCopied: "Link copied",
@@ -299,6 +299,7 @@ const messages = {
299
299
  urlAuthorLabel: "Les mer om {name}",
300
300
  multipleAuthorsLabelAbbreviation: "m. fl.",
301
301
  authorsLabel: "Skrevet av {{names}}",
302
+ authorsLabelLearningpath: "Laget av {{names}}",
302
303
  multipleAuthorsLabelAriaConjunction: "og",
303
304
  copyPageLink: "Kopier lenke til siden",
304
305
  copyPageLinkCopied: "Lenke kopiert",
@@ -299,6 +299,7 @@ const messages = {
299
299
  urlAuthorLabel: "Les meir om {{name}}",
300
300
  multipleAuthorsLabelAbbreviation: "m. fl.",
301
301
  authorsLabel: "Skrive av {{names}}",
302
+ authorsLabelLearningpath: "Laga av {{names}}",
302
303
  multipleAuthorsLabelAriaConjunction: "og",
303
304
  copyPageLink: "Kopier lenke til sida",
304
305
  copyPageLinkCopied: "Lenke kopiert",
@@ -299,6 +299,7 @@ const messages = {
299
299
  urlAuthorLabel: "Loga eanet {{name}} birra",
300
300
  multipleAuthorsLabelAbbreviation: "e.e.",
301
301
  authorsLabel: "Dán lea/leat čállán {{names}}",
302
+ authorsLabelLearningpath: "Laget av {{names}}",
302
303
  multipleAuthorsLabelAriaConjunction: "ja",
303
304
  copyPageLink: "Máŋge liŋkka siidui",
304
305
  copyPageLinkCopied: "Liŋka máŋgejuvvon",
@@ -299,6 +299,7 @@ const messages = {
299
299
  urlAuthorLabel: "Lohkh vielie {name}:n bïjre",
300
300
  multipleAuthorsLabelAbbreviation: "jïh jienebh",
301
301
  authorsLabel: "{{names}} tjaaleme",
302
+ authorsLabelLearningpath: "Laget av {{names}}",
302
303
  multipleAuthorsLabelAriaConjunction: "og",
303
304
  copyPageLink: "Kopijeerh svaalhtesem sæjrose",
304
305
  copyPageLinkCopied: "Svaalhtesem kopijeereme",
@@ -22,8 +22,9 @@ type Props = {
22
22
  footnotes?: FootNote[];
23
23
  displayByline?: boolean;
24
24
  bylineType?: "article" | "learningPath";
25
+ bylineSuffix?: ReactNode;
25
26
  };
26
- export declare const ArticleByline: ({ authors, suppliers, footnotes, licenseBox, published, displayByline, bylineType, }: Props) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const ArticleByline: ({ authors, suppliers, footnotes, licenseBox, published, displayByline, bylineType, bylineSuffix, }: Props) => import("react/jsx-runtime").JSX.Element;
27
28
  interface ArticleBylineAccordionprops extends AccordionItemProps {
28
29
  accordionTitle: ReactNode;
29
30
  }
@@ -92,7 +92,8 @@ const ArticleByline = _ref => {
92
92
  licenseBox,
93
93
  published,
94
94
  displayByline = true,
95
- bylineType = "article"
95
+ bylineType = "article",
96
+ bylineSuffix
96
97
  } = _ref;
97
98
  const {
98
99
  t
@@ -119,11 +120,12 @@ const ArticleByline = _ref => {
119
120
  return () => window.removeEventListener("hashchange", onHashChange);
120
121
  }, [onHashChange]);
121
122
  const showPrimaryContributors = suppliers.length > 0 || authors.length > 0;
123
+ const isLearningpath = bylineType === "learningPath";
122
124
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
123
125
  children: [!!displayByline && /*#__PURE__*/(0, _jsxRuntime.jsxs)(TextWrapper, {
124
- learningpath: bylineType === "learningPath",
126
+ learningpath: isLearningpath,
125
127
  children: [!!showPrimaryContributors && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
126
- children: [authors.length > 0 && `${t("article.authorsLabel", {
128
+ children: [authors.length > 0 && `${t(isLearningpath ? "article.authorsLabelLearningpath" : "article.authorsLabel", {
127
129
  names: renderContributors(authors, t),
128
130
  interpolation: {
129
131
  escapeValue: false
@@ -132,7 +134,7 @@ const ArticleByline = _ref => {
132
134
  }), published ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
133
135
  "data-contributors": showPrimaryContributors,
134
136
  children: [t(`${bylineType}.lastUpdated`), " ", published]
135
- }) : null]
137
+ }) : null, bylineSuffix]
136
138
  }), (!!licenseBox || !!footnotes?.length) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledAccordionRoot, {
137
139
  multiple: true,
138
140
  value: openAccordions,
@@ -289,6 +289,7 @@ declare const messages: {
289
289
  urlAuthorLabel: string;
290
290
  multipleAuthorsLabelAbbreviation: string;
291
291
  authorsLabel: string;
292
+ authorsLabelLearningpath: string;
292
293
  multipleAuthorsLabelAriaConjunction: string;
293
294
  copyPageLink: string;
294
295
  copyPageLinkCopied: string;
@@ -306,6 +306,7 @@ const messages = {
306
306
  urlAuthorLabel: "Read more about {{name}}",
307
307
  multipleAuthorsLabelAbbreviation: "et al.",
308
308
  authorsLabel: "Written by: {{names}}",
309
+ authorsLabelLearningpath: "Made by {{names}}",
309
310
  multipleAuthorsLabelAriaConjunction: "and",
310
311
  copyPageLink: "Copy page-link",
311
312
  copyPageLinkCopied: "Link copied",
@@ -289,6 +289,7 @@ declare const messages: {
289
289
  urlAuthorLabel: string;
290
290
  multipleAuthorsLabelAbbreviation: string;
291
291
  authorsLabel: string;
292
+ authorsLabelLearningpath: string;
292
293
  multipleAuthorsLabelAriaConjunction: string;
293
294
  copyPageLink: string;
294
295
  copyPageLinkCopied: string;
@@ -306,6 +306,7 @@ const messages = {
306
306
  urlAuthorLabel: "Les mer om {name}",
307
307
  multipleAuthorsLabelAbbreviation: "m. fl.",
308
308
  authorsLabel: "Skrevet av {{names}}",
309
+ authorsLabelLearningpath: "Laget av {{names}}",
309
310
  multipleAuthorsLabelAriaConjunction: "og",
310
311
  copyPageLink: "Kopier lenke til siden",
311
312
  copyPageLinkCopied: "Lenke kopiert",
@@ -289,6 +289,7 @@ declare const messages: {
289
289
  urlAuthorLabel: string;
290
290
  multipleAuthorsLabelAbbreviation: string;
291
291
  authorsLabel: string;
292
+ authorsLabelLearningpath: string;
292
293
  multipleAuthorsLabelAriaConjunction: string;
293
294
  copyPageLink: string;
294
295
  copyPageLinkCopied: string;
@@ -306,6 +306,7 @@ const messages = {
306
306
  urlAuthorLabel: "Les meir om {{name}}",
307
307
  multipleAuthorsLabelAbbreviation: "m. fl.",
308
308
  authorsLabel: "Skrive av {{names}}",
309
+ authorsLabelLearningpath: "Laga av {{names}}",
309
310
  multipleAuthorsLabelAriaConjunction: "og",
310
311
  copyPageLink: "Kopier lenke til sida",
311
312
  copyPageLinkCopied: "Lenke kopiert",
@@ -289,6 +289,7 @@ declare const messages: {
289
289
  urlAuthorLabel: string;
290
290
  multipleAuthorsLabelAbbreviation: string;
291
291
  authorsLabel: string;
292
+ authorsLabelLearningpath: string;
292
293
  multipleAuthorsLabelAriaConjunction: string;
293
294
  copyPageLink: string;
294
295
  copyPageLinkCopied: string;
@@ -306,6 +306,7 @@ const messages = {
306
306
  urlAuthorLabel: "Loga eanet {{name}} birra",
307
307
  multipleAuthorsLabelAbbreviation: "e.e.",
308
308
  authorsLabel: "Dán lea/leat čállán {{names}}",
309
+ authorsLabelLearningpath: "Laget av {{names}}",
309
310
  multipleAuthorsLabelAriaConjunction: "ja",
310
311
  copyPageLink: "Máŋge liŋkka siidui",
311
312
  copyPageLinkCopied: "Liŋka máŋgejuvvon",
@@ -289,6 +289,7 @@ declare const messages: {
289
289
  urlAuthorLabel: string;
290
290
  multipleAuthorsLabelAbbreviation: string;
291
291
  authorsLabel: string;
292
+ authorsLabelLearningpath: string;
292
293
  multipleAuthorsLabelAriaConjunction: string;
293
294
  copyPageLink: string;
294
295
  copyPageLinkCopied: string;
@@ -306,6 +306,7 @@ const messages = {
306
306
  urlAuthorLabel: "Lohkh vielie {name}:n bïjre",
307
307
  multipleAuthorsLabelAbbreviation: "jïh jienebh",
308
308
  authorsLabel: "{{names}} tjaaleme",
309
+ authorsLabelLearningpath: "Laget av {{names}}",
309
310
  multipleAuthorsLabelAriaConjunction: "og",
310
311
  copyPageLink: "Kopijeerh svaalhtesem sæjrose",
311
312
  copyPageLinkCopied: "Svaalhtesem kopijeereme",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "56.0.98-alpha.0",
3
+ "version": "56.0.100-alpha.0",
4
4
  "description": "UI component library for NDLA",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -35,8 +35,8 @@
35
35
  "@ndla/core": "^5.0.3",
36
36
  "@ndla/icons": "^8.0.51-alpha.0",
37
37
  "@ndla/licenses": "^8.0.6-alpha.0",
38
- "@ndla/primitives": "^1.0.74-alpha.0",
39
- "@ndla/safelink": "^7.0.75-alpha.0",
38
+ "@ndla/primitives": "^1.0.75-alpha.0",
39
+ "@ndla/safelink": "^7.0.76-alpha.0",
40
40
  "@ndla/styled-system": "^0.0.31",
41
41
  "@ndla/util": "^5.0.5-alpha.0",
42
42
  "html-react-parser": "^5.1.19",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "afc6cf3ee63096705af150d31e41676d0934de80"
61
+ "gitHead": "1ddeff6e6b4528818cba8ab4c486e595dc7fc0e4"
62
62
  }
@@ -75,6 +75,7 @@ type Props = {
75
75
  footnotes?: FootNote[];
76
76
  displayByline?: boolean;
77
77
  bylineType?: "article" | "learningPath";
78
+ bylineSuffix?: ReactNode;
78
79
  };
79
80
 
80
81
  const renderContributors = (contributors: SupplierProps[] | AuthorProps[], t: TFunction) => {
@@ -118,6 +119,7 @@ export const ArticleByline = ({
118
119
  published,
119
120
  displayByline = true,
120
121
  bylineType = "article",
122
+ bylineSuffix,
121
123
  }: Props) => {
122
124
  const { t } = useTranslation();
123
125
  const { pathname } = useLocation();
@@ -147,15 +149,16 @@ export const ArticleByline = ({
147
149
  }, [onHashChange]);
148
150
 
149
151
  const showPrimaryContributors = suppliers.length > 0 || authors.length > 0;
152
+ const isLearningpath = bylineType === "learningPath";
150
153
 
151
154
  return (
152
155
  <Wrapper>
153
156
  {!!displayByline && (
154
- <TextWrapper learningpath={bylineType === "learningPath"}>
157
+ <TextWrapper learningpath={isLearningpath}>
155
158
  {!!showPrimaryContributors && (
156
159
  <span>
157
160
  {authors.length > 0 &&
158
- `${t("article.authorsLabel", {
161
+ `${t(isLearningpath ? "article.authorsLabelLearningpath" : "article.authorsLabel", {
159
162
  names: renderContributors(authors, t),
160
163
  interpolation: { escapeValue: false },
161
164
  })}. `}
@@ -167,6 +170,7 @@ export const ArticleByline = ({
167
170
  {t(`${bylineType}.lastUpdated`)} {published}
168
171
  </div>
169
172
  ) : null}
173
+ {bylineSuffix}
170
174
  </TextWrapper>
171
175
  )}
172
176
  {(!!licenseBox || !!footnotes?.length) && (
@@ -309,6 +309,7 @@ const messages = {
309
309
  urlAuthorLabel: "Read more about {{name}}",
310
310
  multipleAuthorsLabelAbbreviation: "et al.",
311
311
  authorsLabel: "Written by: {{names}}",
312
+ authorsLabelLearningpath: "Made by {{names}}",
312
313
  multipleAuthorsLabelAriaConjunction: "and",
313
314
  copyPageLink: "Copy page-link",
314
315
  copyPageLinkCopied: "Link copied",
@@ -310,6 +310,7 @@ const messages = {
310
310
  urlAuthorLabel: "Les mer om {name}",
311
311
  multipleAuthorsLabelAbbreviation: "m. fl.",
312
312
  authorsLabel: "Skrevet av {{names}}",
313
+ authorsLabelLearningpath: "Laget av {{names}}",
313
314
  multipleAuthorsLabelAriaConjunction: "og",
314
315
  copyPageLink: "Kopier lenke til siden",
315
316
  copyPageLinkCopied: "Lenke kopiert",
@@ -310,6 +310,7 @@ const messages = {
310
310
  urlAuthorLabel: "Les meir om {{name}}",
311
311
  multipleAuthorsLabelAbbreviation: "m. fl.",
312
312
  authorsLabel: "Skrive av {{names}}",
313
+ authorsLabelLearningpath: "Laga av {{names}}",
313
314
  multipleAuthorsLabelAriaConjunction: "og",
314
315
  copyPageLink: "Kopier lenke til sida",
315
316
  copyPageLinkCopied: "Lenke kopiert",
@@ -310,6 +310,7 @@ const messages = {
310
310
  urlAuthorLabel: "Loga eanet {{name}} birra",
311
311
  multipleAuthorsLabelAbbreviation: "e.e.",
312
312
  authorsLabel: "Dán lea/leat čállán {{names}}",
313
+ authorsLabelLearningpath: "Laget av {{names}}",
313
314
  multipleAuthorsLabelAriaConjunction: "ja",
314
315
  copyPageLink: "Máŋge liŋkka siidui",
315
316
  copyPageLinkCopied: "Liŋka máŋgejuvvon",
@@ -310,6 +310,7 @@ const messages = {
310
310
  urlAuthorLabel: "Lohkh vielie {name}:n bïjre",
311
311
  multipleAuthorsLabelAbbreviation: "jïh jienebh",
312
312
  authorsLabel: "{{names}} tjaaleme",
313
+ authorsLabelLearningpath: "Laget av {{names}}",
313
314
  multipleAuthorsLabelAriaConjunction: "og",
314
315
  copyPageLink: "Kopijeerh svaalhtesem sæjrose",
315
316
  copyPageLinkCopied: "Svaalhtesem kopijeereme",