@ndla/ui 8.2.3 → 9.0.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 (92) hide show
  1. package/es/Article/ArticleNotions.js +9 -7
  2. package/es/Figure/Figure.js +6 -5
  3. package/es/Figure/FigureExpandButton.js +6 -6
  4. package/es/Figure/FigureOpenDialogButton.js +45 -0
  5. package/es/Figure/index.js +2 -1
  6. package/es/Image/Image.js +1 -1
  7. package/es/MessageBox/MessageBox.js +8 -8
  8. package/es/Notion/ConceptNotion.js +79 -28
  9. package/es/Notion/FigureNotion.js +5 -6
  10. package/es/Notion/Notion.js +19 -98
  11. package/es/Notion/NotionImage.js +25 -6
  12. package/es/Notion/NotionVisualElement.js +49 -10
  13. package/es/ResourceBox/ResourceBox.js +34 -67
  14. package/es/Topic/Topic.js +21 -21
  15. package/es/all.css +1 -1
  16. package/es/index.js +1 -2
  17. package/es/locale/messages-en.js +6 -4
  18. package/es/locale/messages-nb.js +6 -4
  19. package/es/locale/messages-nn.js +6 -4
  20. package/es/locale/messages-se.js +5 -3
  21. package/es/locale/messages-sma.js +5 -3
  22. package/es/{CloseButton/index.js → model/SubjectTypes.js} +3 -4
  23. package/es/model/index.js +3 -1
  24. package/lib/Article/ArticleNotions.d.ts +2 -1
  25. package/lib/Article/ArticleNotions.js +9 -7
  26. package/lib/Figure/Figure.d.ts +2 -1
  27. package/lib/Figure/Figure.js +6 -5
  28. package/lib/Figure/FigureExpandButton.js +6 -6
  29. package/lib/Figure/FigureOpenDialogButton.d.ts +16 -0
  30. package/lib/Figure/FigureOpenDialogButton.js +57 -0
  31. package/lib/Figure/index.d.ts +1 -0
  32. package/lib/Figure/index.js +8 -0
  33. package/lib/Image/Image.js +1 -1
  34. package/lib/MessageBox/MessageBox.js +9 -9
  35. package/lib/Notion/ConceptNotion.d.ts +6 -7
  36. package/lib/Notion/ConceptNotion.js +84 -30
  37. package/lib/Notion/FigureNotion.d.ts +3 -2
  38. package/lib/Notion/FigureNotion.js +5 -7
  39. package/lib/Notion/Notion.d.ts +1 -12
  40. package/lib/Notion/Notion.js +23 -105
  41. package/lib/Notion/NotionImage.d.ts +2 -1
  42. package/lib/Notion/NotionImage.js +25 -7
  43. package/lib/Notion/NotionVisualElement.d.ts +6 -7
  44. package/lib/Notion/NotionVisualElement.js +48 -18
  45. package/lib/ResourceBox/ResourceBox.js +34 -63
  46. package/lib/Topic/Topic.js +21 -21
  47. package/lib/all.css +1 -1
  48. package/lib/index.d.ts +1 -2
  49. package/lib/index.js +7 -9
  50. package/lib/locale/messages-en.d.ts +5 -1
  51. package/lib/locale/messages-en.js +7 -4
  52. package/lib/locale/messages-nb.d.ts +5 -1
  53. package/lib/locale/messages-nb.js +7 -4
  54. package/lib/locale/messages-nn.d.ts +5 -1
  55. package/lib/locale/messages-nn.js +7 -4
  56. package/lib/locale/messages-se.d.ts +5 -1
  57. package/lib/locale/messages-se.js +6 -3
  58. package/lib/locale/messages-sma.d.ts +5 -1
  59. package/lib/locale/messages-sma.js +6 -3
  60. package/lib/{CloseButton/CloseButton.d.ts → model/SubjectTypes.d.ts} +2 -3
  61. package/lib/model/SubjectTypes.js +18 -0
  62. package/lib/model/index.d.ts +2 -0
  63. package/lib/model/index.js +4 -1
  64. package/package.json +9 -9
  65. package/src/Article/ArticleNotions.tsx +3 -2
  66. package/src/Figure/Figure.tsx +49 -41
  67. package/src/Figure/FigureExpandButton.tsx +4 -4
  68. package/src/Figure/FigureOpenDialogButton.tsx +37 -0
  69. package/src/Figure/component.figure.scss +4 -0
  70. package/src/Figure/index.ts +1 -0
  71. package/src/Image/Image.tsx +1 -1
  72. package/src/MessageBox/MessageBox.tsx +1 -1
  73. package/src/Notion/ConceptNotion.tsx +136 -37
  74. package/src/Notion/FigureNotion.tsx +6 -6
  75. package/src/Notion/Notion.tsx +7 -145
  76. package/src/Notion/NotionImage.tsx +44 -15
  77. package/src/Notion/NotionVisualElement.tsx +35 -8
  78. package/src/ResourceBox/ResourceBox.tsx +47 -102
  79. package/src/Topic/Topic.tsx +1 -1
  80. package/src/index.ts +2 -2
  81. package/src/locale/messages-en.ts +6 -2
  82. package/src/locale/messages-nb.ts +6 -2
  83. package/src/locale/messages-nn.ts +6 -2
  84. package/src/locale/messages-se.ts +5 -1
  85. package/src/locale/messages-sma.ts +5 -1
  86. package/{lib/CloseButton/index.d.ts → src/model/SubjectTypes.ts} +4 -4
  87. package/src/model/index.ts +2 -0
  88. package/es/CloseButton/CloseButton.js +0 -46
  89. package/lib/CloseButton/CloseButton.js +0 -54
  90. package/lib/CloseButton/index.js +0 -26
  91. package/src/CloseButton/CloseButton.tsx +0 -36
  92. package/src/CloseButton/index.ts +0 -13
@@ -4,12 +4,24 @@
4
4
  * This source code is licensed under the GPLv3 license found in the
5
5
  * LICENSE file in the root directory of this source tree. *
6
6
  */
7
-
8
- import React from 'react';
7
+ import { css } from '@emotion/core';
8
+ import styled from '@emotion/styled';
9
+ import React, { ReactNode } from 'react';
9
10
  import { Copyright } from '../types';
10
11
  import FigureNotion from './FigureNotion';
11
12
 
13
+ const StyledIframe = styled.iframe<{ type: string }>`
14
+ ${(props) =>
15
+ props.type === 'video'
16
+ ? css`
17
+ min-height: 400px;
18
+ `
19
+ : ''}
20
+ `;
21
+
12
22
  export type NotionVisualElementType = {
23
+ element?: ReactNode;
24
+ type?: 'video' | 'image' | 'h5p';
13
25
  resource?: string;
14
26
  title?: string;
15
27
  url?: string;
@@ -22,17 +34,28 @@ export type NotionVisualElementType = {
22
34
 
23
35
  interface Props {
24
36
  visualElement: NotionVisualElementType;
37
+ id: string;
38
+ figureId: string;
25
39
  }
40
+ const supportedEmbedTypes = ['brightcove', 'h5p', 'iframe', 'external', 'image'];
26
41
 
27
- const supportedEmbedTypes = ['brightcove', 'h5p', 'iframe', 'external'];
28
- const NotionVisualElement = ({ visualElement }: Props) => {
29
- const id = '1';
30
- const figureId = 'figure-1';
42
+ const getType = (resource: string) => {
43
+ if (resource === 'brightcove') {
44
+ return 'video';
45
+ }
46
+ if (resource === 'image') {
47
+ return 'image';
48
+ }
49
+ return 'h5p';
50
+ };
51
+
52
+ const NotionVisualElement = ({ visualElement, id, figureId }: Props) => {
31
53
  if (!visualElement.resource || !supportedEmbedTypes.includes(visualElement.resource)) {
32
54
  return <p>Embed type is not supported!</p>;
33
55
  }
34
56
 
35
- const type = visualElement.resource === 'brightcove' ? 'video' : 'h5p';
57
+ const type = getType(visualElement.resource);
58
+
36
59
  return (
37
60
  <FigureNotion
38
61
  resizeIframe
@@ -42,7 +65,11 @@ const NotionVisualElement = ({ visualElement }: Props) => {
42
65
  copyright={visualElement.copyright}
43
66
  licenseString={visualElement.copyright?.license?.license ?? ''}
44
67
  type={type}>
45
- <iframe title={visualElement.title} src={visualElement.url} />
68
+ {visualElement.image?.src ? (
69
+ <img src={visualElement.image?.src} alt={visualElement.image.alt} />
70
+ ) : (
71
+ <StyledIframe type={type} src={visualElement.url} title={visualElement.title} />
72
+ )}
46
73
  </FigureNotion>
47
74
  );
48
75
  };
@@ -15,124 +15,75 @@ import { SafeLinkButton } from '@ndla/safelink';
15
15
  import styled from '@emotion/styled';
16
16
  import Image from '../Image';
17
17
 
18
- const BoxWrapper = styled.div`
18
+ const ResourceBoxContainer = styled.div`
19
19
  display: flex;
20
- padding-top: 20px;
21
- padding-bottom: 20px;
20
+ padding: 20px;
22
21
  border-radius: 5px;
23
22
  border: 1px solid ${colors.brand.light};
24
23
  position: relative;
25
- left: -16.6666666667%;
26
- width: 133.3333333333%;
27
- align-items: stretch;
28
- margin-bottom: 24px;
29
24
  font-family: ${fonts.sans};
30
25
  box-shadow: 0px 20px 35px -15px rgba(32, 88, 143, 0.15);
31
26
  gap: 40px;
32
27
 
33
28
  ${mq.range({ until: breakpoints.desktop })} {
34
- gap: 1px;
29
+ gap: 0;
35
30
  flex-direction: column;
36
- margin: 0 auto;
37
- width: 80%;
38
- left: 0;
39
- padding-left: 24px;
40
- padding-right: 24px;
41
- padding-bottom: 0;
42
- margin-bottom: 24px;
43
- height: auto;
31
+ padding-top: 30px;
44
32
  text-align: center;
45
33
  }
46
34
  `;
47
35
 
48
- const Boxtitle = styled.h3`
36
+ const Title = styled.h3`
49
37
  font-weight: ${fonts.weight.bold};
50
38
  font-size: ${fonts.sizes(18)};
51
39
  margin-top: 0;
52
- ${mq.range({ until: breakpoints.desktop })} {
53
- text-align: center;
54
- width: 100%;
55
- }
56
40
  `;
57
41
 
58
- const Boxcaption = styled.p`
42
+ const Caption = styled.p`
59
43
  font-size: ${fonts.sizes(14)};
44
+ max-width: 600px;
60
45
 
61
46
  ${mq.range({ until: breakpoints.desktop })} {
62
47
  line-height: 22px;
63
48
  }
64
49
  `;
65
50
 
66
- const StyledButtonDiv = styled.div`
51
+ const TextWrapper = styled.div`
52
+ display: flex;
53
+ flex-direction: column;
67
54
  align-items: flex-start;
68
55
  ${mq.range({ until: breakpoints.desktop })} {
69
- padding-bottom: 10px;
70
- margin: 0 auto;
56
+ align-items: center;
57
+ padding-top: 10px;
71
58
  }
72
59
  `;
73
- const ResourceBoxStyledButton = styled(SafeLinkButton)`
60
+
61
+ const StyledButton = styled(SafeLinkButton)`
74
62
  border: 1px solid ${colors.brand.tertiary};
75
63
  :hover {
76
64
  background-color: ${colors.brand.primary};
65
+ border: 1px solid ${colors.brand.primary};
77
66
  color: white;
78
67
  }
79
- ${mq.range({ until: breakpoints.desktop })} {
80
- width: 210px;
81
- }
82
68
  `;
83
- const ResourceBoxLaunchIcon = styled(Launch)`
69
+
70
+ const StyledLaunchIcon = styled(Launch)`
84
71
  margin-left: 8px;
85
72
  height: 15px;
86
73
  width: 15px;
87
74
  `;
88
75
 
89
- const BoxImage = styled(Image)`
90
- object-fit: cover;
91
- width: 134px;
92
- height: 134px;
93
- border-radius: 5px;
94
-
95
- ${mq.range({ until: breakpoints.desktop })} {
96
- width: 200px;
97
- height: 200px;
98
- }
99
- `;
100
- const ImageSectionWrapper = styled.div`
101
- align-items: flex-start;
102
- display: flex;
103
- justify-content: center;
104
- margin-left: 20px;
105
- ${mq.range({ until: breakpoints.desktop })} {
106
- margin: 0 auto;
107
- padding-top: 10px;
108
- }
109
- `;
110
-
111
- const CaptionSectionWrapper = styled.div`
112
- max-width: 600px;
113
- ${mq.range({ until: breakpoints.desktop })} {
114
- margin: 0 auto;
115
- }
116
- `;
117
-
118
- const CenterItems = styled.div`
119
- display: flex;
120
- justify-content: center;
121
- align-items: flex-start;
122
- flex-flow: column;
123
- ${mq.range({ until: breakpoints.desktop })} {
124
- width: 100%;
125
- }
126
- `;
76
+ const ImageWrapper = styled.div`
77
+ img {
78
+ object-fit: cover;
79
+ width: 134px;
80
+ height: 134px;
81
+ border-radius: 5px;
127
82
 
128
- const TitleAndLicence = styled.div`
129
- display: flex;
130
- justify-content: space-between;
131
- ${mq.range({ until: breakpoints.desktop })} {
132
- text-align: center;
133
- padding-top: 10px;
134
- max-width: 200px;
135
- margin: 0 auto;
83
+ ${mq.range({ until: breakpoints.desktop })} {
84
+ width: 200px;
85
+ height: 200px;
86
+ }
136
87
  }
137
88
  `;
138
89
 
@@ -157,33 +108,27 @@ type Props = {
157
108
  export const ResourceBox = ({ image, title, caption, licenseRights, locale, authors, url }: Props) => {
158
109
  const { t } = useTranslation();
159
110
  return (
160
- <BoxWrapper>
161
- <ImageSectionWrapper>
162
- <BoxImage alt={title} src={image} sizes="25, 25" />
163
- </ImageSectionWrapper>
164
- <CenterItems>
165
- <CaptionSectionWrapper>
166
- <TitleAndLicence>
167
- <Boxtitle>{title}</Boxtitle>
168
- <LincenseWrapper>
169
- <LicenseByline licenseRights={licenseRights} locale={locale} marginRight color={colors.brand.tertiary}>
170
- <div className="c-figure__byline-author-buttons">
171
- <span className="c-figure__byline-authors">{authors?.map((author) => author.name).join(' ')}</span>
172
- </div>
173
- </LicenseByline>
174
- </LincenseWrapper>
175
- </TitleAndLicence>
176
- <Boxcaption>{caption}</Boxcaption>
177
- </CaptionSectionWrapper>
111
+ <ResourceBoxContainer>
112
+ <LincenseWrapper>
113
+ <LicenseByline licenseRights={licenseRights} locale={locale} marginRight color={colors.brand.tertiary}>
114
+ <div className="c-figure__byline-author-buttons">
115
+ <span className="c-figure__byline-authors">{authors?.map((author) => author.name).join(' ')}</span>
116
+ </div>
117
+ </LicenseByline>
118
+ </LincenseWrapper>
119
+ <ImageWrapper>
120
+ <Image alt={title} src={image} />
121
+ </ImageWrapper>
122
+ <TextWrapper>
123
+ <Title>{title}</Title>
124
+ <Caption>{caption}</Caption>
178
125
 
179
- <StyledButtonDiv>
180
- <ResourceBoxStyledButton to={url} target="_blank" outline borderShape="rounded">
181
- {t('license.other.itemImage.ariaLabel')}
182
- <ResourceBoxLaunchIcon aria-hidden />
183
- </ResourceBoxStyledButton>
184
- </StyledButtonDiv>
185
- </CenterItems>
186
- </BoxWrapper>
126
+ <StyledButton to={url} target="_blank" outline borderShape="rounded">
127
+ {t('license.other.itemImage.ariaLabel')}
128
+ <StyledLaunchIcon aria-hidden />
129
+ </StyledButton>
130
+ </TextWrapper>
131
+ </ResourceBoxContainer>
187
132
  );
188
133
  };
189
134
 
@@ -277,7 +277,7 @@ const Topic = ({
277
277
  <ShowVisualElementWrapper>
278
278
  <TopicHeaderImage
279
279
  src={`${topic.image.url}?${makeSrcQueryString(
280
- 400,
280
+ 800,
281
281
  topic.image.crop,
282
282
  topic.image.focalPoint,
283
283
  )}`}
package/src/index.ts CHANGED
@@ -81,7 +81,7 @@ export {
81
81
 
82
82
  export { Footer, EditorName, FooterText, FooterAuth } from './Footer';
83
83
 
84
- export { Figure, FigureCaption, FigureLicenseDialog, FigureExpandButton } from './Figure';
84
+ export { Figure, FigureCaption, FigureLicenseDialog, FigureExpandButton, FigureOpenDialogButton } from './Figure';
85
85
 
86
86
  export { LanguageSelector } from './LanguageSelector';
87
87
 
@@ -119,7 +119,6 @@ export { MessageBox, MessageBoxTag, MessageBoxType } from './MessageBox';
119
119
 
120
120
  export { ResourceBox } from './ResourceBox';
121
121
 
122
- export { default as CloseButton } from './CloseButton';
123
122
  export { default as AudioPlayer, initAudioPlayers } from './AudioPlayer';
124
123
 
125
124
  export { NavigationHeading, NavigationBox, NavigationTopicAbout } from './Navigation';
@@ -220,4 +219,5 @@ export { default as CopyParagraphButton } from './CopyParagraphButton';
220
219
 
221
220
  export { default as ContentPlaceholder } from './ContentPlaceholder';
222
221
  export { Notion, ConceptNotion } from './Notion';
222
+
223
223
  export { BannerCard } from './BannerCard';
@@ -9,7 +9,7 @@
9
9
  import { contributorTypes } from '@ndla/licenses';
10
10
  import constants from '../model';
11
11
 
12
- export const { contentTypes, subjectCategories } = constants;
12
+ export const { contentTypes, subjectCategories, subjectTypes } = constants;
13
13
 
14
14
  const titleTemplate = ' - NDLA';
15
15
 
@@ -53,6 +53,10 @@ const messages = {
53
53
  [subjectCategories.PROGRAMME_SUBJECTS]: 'Programme subj. SF',
54
54
  [subjectCategories.SPECIALIZED_SUBJECTS]: 'Programme subj. YF',
55
55
  },
56
+ subjectTypes: {
57
+ [subjectTypes.SUBJECT]: 'Subject',
58
+ [subjectTypes.RESOURCE_COLLECTION]: 'Resource collection',
59
+ },
56
60
  searchPage: {
57
61
  noHits: 'Your search - {{query}} - did not match any articles. ',
58
62
  noHitsShort: 'No results for search: {{query}}',
@@ -409,7 +413,7 @@ const messages = {
409
413
  images: 'Images',
410
414
  audio: 'Audio',
411
415
  video: 'Video',
412
- h5p: 'H5P',
416
+ h5p: 'h5p',
413
417
  files: 'Files',
414
418
  embedlink: 'Embedded link',
415
419
  other: 'Other content',
@@ -9,7 +9,7 @@
9
9
  import { contributorTypes } from '@ndla/licenses';
10
10
  import constants from '../model';
11
11
 
12
- export const { contentTypes, subjectCategories } = constants;
12
+ export const { contentTypes, subjectCategories, subjectTypes } = constants;
13
13
 
14
14
  const titleTemplate = ' - NDLA';
15
15
 
@@ -53,6 +53,10 @@ const messages = {
53
53
  [subjectCategories.PROGRAMME_SUBJECTS]: 'Programfag SF',
54
54
  [subjectCategories.SPECIALIZED_SUBJECTS]: 'Yrkesfag',
55
55
  },
56
+ subjectTypes: {
57
+ [subjectTypes.SUBJECT]: 'Fag',
58
+ [subjectTypes.RESOURCE_COLLECTION]: 'Ressurssamling',
59
+ },
56
60
  searchPage: {
57
61
  noHits: 'Ingen artikler samsvarte med søket ditt på: {{query}}',
58
62
  noHitsShort: 'Ingen treff på søk: {{query}}',
@@ -422,7 +426,7 @@ const messages = {
422
426
  images: 'Bilder',
423
427
  audio: 'Lyd',
424
428
  video: 'Video',
425
- h5p: 'H5P',
429
+ h5p: 'h5p',
426
430
  files: 'Filer',
427
431
  embedlink: 'Innbyggingslenke',
428
432
  concept: 'Forklaringer',
@@ -9,7 +9,7 @@
9
9
  import { contributorTypes } from '@ndla/licenses';
10
10
  import constants from '../model';
11
11
 
12
- export const { contentTypes, subjectCategories } = constants;
12
+ export const { contentTypes, subjectCategories, subjectTypes } = constants;
13
13
 
14
14
  const titleTemplate = ' - NDLA';
15
15
 
@@ -53,6 +53,10 @@ const messages = {
53
53
  [subjectCategories.PROGRAMME_SUBJECTS]: 'Programfag SF',
54
54
  [subjectCategories.SPECIALIZED_SUBJECTS]: 'Yrkesfag',
55
55
  },
56
+ subjectTypes: {
57
+ [subjectTypes.SUBJECT]: 'Fag',
58
+ [subjectTypes.RESOURCE_COLLECTION]: 'Ressurssamling',
59
+ },
56
60
  searchPage: {
57
61
  noHits: 'Ingen artiklar samsvarte med søket ditt på: {{query}}',
58
62
  noHitsShort: 'Ingen treff på søk: {{query}}',
@@ -423,7 +427,7 @@ const messages = {
423
427
  images: 'Bilete',
424
428
  audio: 'Lyd',
425
429
  video: 'Video',
426
- h5p: 'H5P',
430
+ h5p: 'h5p',
427
431
  files: 'Filer',
428
432
  embedlink: 'Innbyggingslenke',
429
433
  other: 'Anna innhald',
@@ -9,7 +9,7 @@
9
9
  import { contributorTypes } from '@ndla/licenses';
10
10
  import constants from '../model';
11
11
 
12
- export const { contentTypes, subjectCategories } = constants;
12
+ export const { contentTypes, subjectCategories, subjectTypes } = constants;
13
13
 
14
14
  const titleTemplate = ' - NDLA';
15
15
 
@@ -53,6 +53,10 @@ const messages = {
53
53
  [subjectCategories.PROGRAMME_SUBJECTS]: 'Programfag SF',
54
54
  [subjectCategories.SPECIALIZED_SUBJECTS]: 'Yrkesfag',
55
55
  },
56
+ subjectTypes: {
57
+ [subjectTypes.SUBJECT]: 'Fag',
58
+ [subjectTypes.RESOURCE_COLLECTION]: 'Ressurssamling',
59
+ },
56
60
  searchPage: {
57
61
  noHits: 'Ingen artikler samsvarte med søket ditt på: {{query}}',
58
62
  noHitsShort: 'Ingen treff på søk: {{query}}',
@@ -9,7 +9,7 @@
9
9
  import { contributorTypes } from '@ndla/licenses';
10
10
  import constants from '../model';
11
11
 
12
- export const { contentTypes, subjectCategories } = constants;
12
+ export const { contentTypes, subjectCategories, subjectTypes } = constants;
13
13
 
14
14
  const titleTemplate = ' - NDLA';
15
15
 
@@ -53,6 +53,10 @@ const messages = {
53
53
  [subjectCategories.PROGRAMME_SUBJECTS]: 'Programfag SF',
54
54
  [subjectCategories.SPECIALIZED_SUBJECTS]: 'Yrkesfag',
55
55
  },
56
+ subjectTypes: {
57
+ [subjectTypes.SUBJECT]: 'Fag',
58
+ [subjectTypes.RESOURCE_COLLECTION]: 'Ressurssamling',
59
+ },
56
60
  searchPage: {
57
61
  noHits: 'Ingen artikler samsvarte med søket ditt på: {{query}}',
58
62
  noHitsShort: 'Ingen treff på søk: {{query}}',
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright (c) 2019-present, NDLA.
2
+ * Copyright (c) 2022-present, NDLA.
3
3
  *
4
4
  * This source code is licensed under the GPLv3 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import CloseButton from './CloseButton';
9
- export { CloseButton };
10
- export default CloseButton;
8
+
9
+ export const SUBJECT = 'subject';
10
+ export const RESOURCE_COLLECTION = 'resourceCollection';
@@ -8,10 +8,12 @@
8
8
 
9
9
  import * as contentTypes from './ContentType';
10
10
  import * as subjectCategories from './SubjectCategories';
11
+ import * as subjectTypes from './SubjectTypes';
11
12
 
12
13
  const model = {
13
14
  contentTypes,
14
15
  subjectCategories,
16
+ subjectTypes,
15
17
  };
16
18
 
17
19
  export default model;
@@ -1,46 +0,0 @@
1
- import _styled from "@emotion/styled-base";
2
-
3
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
-
5
- 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)."; }
6
-
7
- /**
8
- * Copyright (c) 2022-present, NDLA.
9
- *
10
- * This source code is licensed under the GPLv3 license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- *
13
- */
14
- import React from 'react';
15
- import { Cross } from '@ndla/icons/action';
16
- import { useTranslation } from 'react-i18next';
17
- import { colors } from '@ndla/core';
18
- import { jsx as ___EmotionJSX } from "@emotion/core";
19
-
20
- var StyledButton = _styled("button", {
21
- target: "e4bzt4x0",
22
- label: "StyledButton"
23
- })(process.env.NODE_ENV === "production" ? {
24
- name: "1x6nvfn",
25
- styles: "background-color:transparent;border:none;display:flex;cursor:pointer;"
26
- } : {
27
- name: "1x6nvfn",
28
- styles: "background-color:transparent;border:none;display:flex;cursor:pointer;",
29
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNsb3NlQnV0dG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFha0MiLCJmaWxlIjoiQ2xvc2VCdXR0b24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjItcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUa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cyAvPlxuICAgIDwvU3R5bGVkQnV0dG9uPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQ2xvc2VCdXR0b247XG4iXX0= */",
30
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
31
- });
32
-
33
- var StyledCross = /*#__PURE__*/_styled(Cross, {
34
- target: "e4bzt4x1",
35
- label: "StyledCross"
36
- })("height:24px;width:24px;color:", colors.text.primary, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNsb3NlQnV0dG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFvQmlDIiwiZmlsZSI6IkNsb3NlQnV0dG9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IChjKSAyMDIyLXByZXNlbnQsIE5ETEEuXG4gKlxuICogVGhpcyBzb3VyY2UgY29kZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgR1BMdjMgbGljZW5zZSBmb3VuZCBpbiB0aGVcbiAqIExJQ0VOU0UgZmlsZSBpbiB0aGUgcm9vdCBkaXJlY3Rvcnkgb2YgdGhpcyBzb3VyY2UgdHJlZS5cbiAqXG4gKi9cbmltcG9ydCBSZWFjdCwgeyBCdXR0b25IVE1MQXR0cmlidXRlcyB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IENyb3NzIH0gZnJvbSAnQG5kbGEvaWNvbnMvYWN0aW9uJztcbmltcG9ydCB7IHVzZVRyYW5zbGF0aW9uIH0gZnJvbSAncmVhY3QtaTE4bmV4dCc7XG5pbXBvcnQgeyBjb2xvcnMgfSBmcm9tICdAbmRsYS9jb3JlJztcblxuY29uc3QgU3R5bGVkQnV0dG9uID0gc3R5bGVkLmJ1dHRvbmBcbiAgYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7XG4gIGJvcmRlcjogbm9uZTtcbiAgZGlzcGxheTogZmxleDtcbiAgY3Vyc29yOiBwb2ludGVyO1xuYDtcblxuY29uc3QgU3R5bGVkQ3Jvc3MgPSBzdHlsZWQoQ3Jvc3MpYFxuICBoZWlnaHQ6IDI0cHg7XG4gIHdpZHRoOiAyNHB4O1xuICBjb2xvcjogJHtjb2xvcnMudGV4dC5wcmltYXJ5fTtcbmA7XG5cbmV4cG9ydCBjb25zdCBDbG9zZUJ1dHRvbiA9IChwcm9wczogQnV0dG9uSFRNTEF0dHJpYnV0ZXM8SFRNTEJ1dHRvbkVsZW1lbnQ+KSA9PiB7XG4gIGNvbnN0IHsgdCB9ID0gdXNlVHJhbnNsYXRpb24oKTtcbiAgcmV0dXJuIChcbiAgICA8U3R5bGVkQnV0dG9uIGFyaWEtbGFiZWw9e3QoJ2Nsb3NlJyl9IHsuLi5wcm9wc30+XG4gICAgICA8U3R5bGVkQ3Jvc3MgLz5cbiAgICA8L1N0eWxlZEJ1dHRvbj5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IENsb3NlQnV0dG9uO1xuIl19 */"));
37
-
38
- export var CloseButton = function CloseButton(props) {
39
- var _useTranslation = useTranslation(),
40
- t = _useTranslation.t;
41
-
42
- return ___EmotionJSX(StyledButton, _extends({
43
- "aria-label": t('close')
44
- }, props), ___EmotionJSX(StyledCross, null));
45
- };
46
- export default CloseButton;
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = exports.CloseButton = void 0;
7
-
8
- var _styledBase = _interopRequireDefault(require("@emotion/styled-base"));
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _action = require("@ndla/icons/action");
13
-
14
- var _reactI18next = require("react-i18next");
15
-
16
- var _core = require("@ndla/core");
17
-
18
- var _core2 = require("@emotion/core");
19
-
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
-
22
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
-
24
- 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)."; }
25
-
26
- var StyledButton = (0, _styledBase["default"])("button", {
27
- target: "e4bzt4x0",
28
- label: "StyledButton"
29
- })(process.env.NODE_ENV === "production" ? {
30
- name: "1x6nvfn",
31
- styles: "background-color:transparent;border:none;display:flex;cursor:pointer;"
32
- } : {
33
- name: "1x6nvfn",
34
- styles: "background-color:transparent;border:none;display:flex;cursor:pointer;",
35
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNsb3NlQnV0dG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFha0MiLCJmaWxlIjoiQ2xvc2VCdXR0b24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjItcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuaW1wb3J0IFJlYWN0LCB7IEJ1dHRvbkhUTUxBdHRyaWJ1dGVzIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgQ3Jvc3MgfSBmcm9tICdAbmRsYS9pY29ucy9hY3Rpb24nO1xuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tICdyZWFjdC1pMThuZXh0JztcbmltcG9ydCB7IGNvbG9ycyB9IGZyb20gJ0BuZGxhL2NvcmUnO1xuXG5jb25zdCBTdHlsZWRCdXR0b24gPSBzdHlsZWQuYnV0dG9uYFxuICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDtcbiAgYm9yZGVyOiBub25lO1xuICBkaXNwbGF5OiBmbGV4O1xuICBjdXJzb3I6IHBvaW50ZXI7XG5gO1xuXG5jb25zdCBTdHlsZWRDcm9zcyA9IHN0eWxlZChDcm9zcylgXG4gIGhlaWdodDogMjRweDtcbiAgd2lkdGg6IDI0cHg7XG4gIGNvbG9yOiAke2NvbG9ycy50ZXh0LnByaW1hcnl9O1xuYDtcblxuZXhwb3J0IGNvbnN0IENsb3NlQnV0dG9uID0gKHByb3BzOiBCdXR0b25IVE1MQXR0cmlidXRlczxIVE1MQnV0dG9uRWxlbWVudD4pID0+IHtcbiAgY29uc3QgeyB0IH0gPSB1c2VUcmFuc2xhdGlvbigpO1xuICByZXR1cm4gKFxuICAgIDxTdHlsZWRCdXR0b24gYXJpYS1sYWJlbD17dCgnY2xvc2UnKX0gey4uLnByb3BzfT5cbiAgICAgIDxTdHlsZWRDcm9zcyAvPlxuICAgIDwvU3R5bGVkQnV0dG9uPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQ2xvc2VCdXR0b247XG4iXX0= */",
36
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
37
- });
38
- var StyledCross = ( /*#__PURE__*/0, _styledBase["default"])(_action.Cross, {
39
- target: "e4bzt4x1",
40
- label: "StyledCross"
41
- })("height:24px;width:24px;color:", _core.colors.text.primary, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIj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0dHJpYnV0ZXM8SFRNTEJ1dHRvbkVsZW1lbnQ+KSA9PiB7XG4gIGNvbnN0IHsgdCB9ID0gdXNlVHJhbnNsYXRpb24oKTtcbiAgcmV0dXJuIChcbiAgICA8U3R5bGVkQnV0dG9uIGFyaWEtbGFiZWw9e3QoJ2Nsb3NlJyl9IHsuLi5wcm9wc30+XG4gICAgICA8U3R5bGVkQ3Jvc3MgLz5cbiAgICA8L1N0eWxlZEJ1dHRvbj5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IENsb3NlQnV0dG9uO1xuIl19 */"));
42
-
43
- var CloseButton = function CloseButton(props) {
44
- var _useTranslation = (0, _reactI18next.useTranslation)(),
45
- t = _useTranslation.t;
46
-
47
- return (0, _core2.jsx)(StyledButton, _extends({
48
- "aria-label": t('close')
49
- }, props), (0, _core2.jsx)(StyledCross, null));
50
- };
51
-
52
- exports.CloseButton = CloseButton;
53
- var _default = CloseButton;
54
- exports["default"] = _default;
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "CloseButton", {
7
- enumerable: true,
8
- get: function get() {
9
- return _CloseButton["default"];
10
- }
11
- });
12
- exports["default"] = void 0;
13
-
14
- var _CloseButton = _interopRequireDefault(require("./CloseButton"));
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
-
18
- /**
19
- * Copyright (c) 2019-present, NDLA.
20
- *
21
- * This source code is licensed under the GPLv3 license found in the
22
- * LICENSE file in the root directory of this source tree.
23
- *
24
- */
25
- var _default = _CloseButton["default"];
26
- exports["default"] = _default;
@@ -1,36 +0,0 @@
1
- /**
2
- * Copyright (c) 2022-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
- import React, { ButtonHTMLAttributes } from 'react';
9
- import styled from '@emotion/styled';
10
- import { Cross } from '@ndla/icons/action';
11
- import { useTranslation } from 'react-i18next';
12
- import { colors } from '@ndla/core';
13
-
14
- const StyledButton = styled.button`
15
- background-color: transparent;
16
- border: none;
17
- display: flex;
18
- cursor: pointer;
19
- `;
20
-
21
- const StyledCross = styled(Cross)`
22
- height: 24px;
23
- width: 24px;
24
- color: ${colors.text.primary};
25
- `;
26
-
27
- export const CloseButton = (props: ButtonHTMLAttributes<HTMLButtonElement>) => {
28
- const { t } = useTranslation();
29
- return (
30
- <StyledButton aria-label={t('close')} {...props}>
31
- <StyledCross />
32
- </StyledButton>
33
- );
34
- };
35
-
36
- export default CloseButton;
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-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 CloseButton from './CloseButton';
10
-
11
- export { CloseButton };
12
-
13
- export default CloseButton;