@ndla/ui 33.0.5 → 33.0.7
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/es/Footer/FooterPrivacy.js +19 -8
- package/es/Image/Image.js +5 -5
- package/es/Image/ImageLink.js +5 -5
- package/es/ResourcesWrapper/ResourcesTopicTitle.js +63 -31
- package/es/ResourcesWrapper/ResourcesWrapper.js +12 -16
- package/es/ResourcesWrapper/index.js +0 -1
- package/es/SearchTypeResult/SearchItemList.js +11 -11
- package/es/Subject/Subject.js +15 -21
- package/es/Subject/index.js +1 -6
- package/es/all.css +1 -1
- package/es/index.js +2 -3
- package/es/locale/messages-en.js +1 -1
- package/es/locale/messages-nb.js +2 -2
- package/es/locale/messages-nn.js +1 -1
- package/es/locale/messages-se.js +1 -1
- package/es/locale/messages-sma.js +1 -1
- package/lib/Footer/FooterPrivacy.js +17 -8
- package/lib/Image/Image.js +5 -5
- package/lib/Image/ImageLink.js +5 -5
- package/lib/ResourcesWrapper/ResourcesTopicTitle.js +62 -30
- package/lib/ResourcesWrapper/ResourcesWrapper.d.ts +4 -6
- package/lib/ResourcesWrapper/ResourcesWrapper.js +13 -17
- package/lib/ResourcesWrapper/index.d.ts +0 -1
- package/lib/ResourcesWrapper/index.js +0 -7
- package/lib/SearchTypeResult/SearchItemList.js +11 -11
- package/lib/Subject/Subject.d.ts +0 -3
- package/lib/Subject/Subject.js +16 -23
- package/lib/Subject/index.d.ts +1 -6
- package/lib/Subject/index.js +0 -41
- package/lib/all.css +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.js +0 -57
- package/lib/locale/messages-en.js +1 -1
- package/lib/locale/messages-nb.js +2 -2
- package/lib/locale/messages-nn.js +1 -1
- package/lib/locale/messages-se.js +1 -1
- package/lib/locale/messages-sma.js +1 -1
- package/package.json +6 -6
- package/src/Footer/FooterPrivacy.tsx +14 -5
- package/src/Image/Image.tsx +0 -2
- package/src/Image/ImageLink.tsx +0 -2
- package/src/Image/__tests__/__snapshots__/Image-test.jsx.snap +0 -6
- package/src/LetterFilter/LetterFilter.stories.tsx +1 -1
- package/src/MyNdla/Resource/Folder.stories.mdx +1 -1
- package/src/Resource/BlockResource.stories.mdx +1 -1
- package/src/Resource/Resource.stories.mdx +1 -1
- package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +118 -15
- package/src/ResourcesWrapper/ResourcesWrapper.tsx +14 -13
- package/src/ResourcesWrapper/index.ts +0 -1
- package/src/SearchTypeResult/SearchItemList.tsx +1 -0
- package/src/Subject/Subject.tsx +0 -4
- package/src/Subject/index.ts +0 -6
- package/src/index.ts +1 -9
- package/src/locale/messages-en.ts +1 -1
- package/src/locale/messages-nb.ts +2 -2
- package/src/locale/messages-nn.ts +1 -1
- package/src/locale/messages-se.ts +1 -1
- package/src/locale/messages-sma.ts +1 -1
- package/src/main.scss +0 -2
- package/es/ResourcesWrapper/ResourcesTitle.js +0 -28
- package/es/Subject/SubjectAbout.js +0 -81
- package/es/Subject/SubjectArchive.js +0 -203
- package/es/Subject/SubjectLinks.js +0 -53
- package/es/Subject/SubjectShortcuts.js +0 -136
- package/es/TopicIntroductionList/TopicIntroduction.js +0 -90
- package/es/TopicIntroductionList/TopicIntroductionList.js +0 -68
- package/es/TopicIntroductionList/TopicIntroductionShortcuts.js +0 -86
- package/es/TopicIntroductionList/TopicShortcutItem.js +0 -43
- package/es/TopicIntroductionList/index.js +0 -10
- package/lib/ResourcesWrapper/ResourcesTitle.d.ts +0 -13
- package/lib/ResourcesWrapper/ResourcesTitle.js +0 -27
- package/lib/Subject/SubjectAbout.d.ts +0 -12
- package/lib/Subject/SubjectAbout.js +0 -88
- package/lib/Subject/SubjectArchive.d.ts +0 -32
- package/lib/Subject/SubjectArchive.js +0 -211
- package/lib/Subject/SubjectLinks.d.ts +0 -12
- package/lib/Subject/SubjectLinks.js +0 -60
- package/lib/Subject/SubjectShortcuts.d.ts +0 -34
- package/lib/Subject/SubjectShortcuts.js +0 -137
- package/lib/TopicIntroductionList/TopicIntroduction.d.ts +0 -21
- package/lib/TopicIntroductionList/TopicIntroduction.js +0 -97
- package/lib/TopicIntroductionList/TopicIntroductionList.d.ts +0 -35
- package/lib/TopicIntroductionList/TopicIntroductionList.js +0 -67
- package/lib/TopicIntroductionList/TopicIntroductionShortcuts.d.ts +0 -8
- package/lib/TopicIntroductionList/TopicIntroductionShortcuts.js +0 -96
- package/lib/TopicIntroductionList/TopicShortcutItem.d.ts +0 -6
- package/lib/TopicIntroductionList/TopicShortcutItem.js +0 -50
- package/lib/TopicIntroductionList/index.d.ts +0 -9
- package/lib/TopicIntroductionList/index.js +0 -17
- package/src/ResourcesWrapper/ResourcesTitle.tsx +0 -23
- package/src/ResourcesWrapper/component.resources.scss +0 -216
- package/src/Subject/SubjectAbout.tsx +0 -116
- package/src/Subject/SubjectArchive.tsx +0 -221
- package/src/Subject/SubjectLinks.tsx +0 -47
- package/src/Subject/SubjectShortcuts.tsx +0 -158
- package/src/TopicIntroductionList/TopicIntroduction.tsx +0 -100
- package/src/TopicIntroductionList/TopicIntroductionList.tsx +0 -93
- package/src/TopicIntroductionList/TopicIntroductionShortcuts.tsx +0 -71
- package/src/TopicIntroductionList/TopicShortcutItem.tsx +0 -29
- package/src/TopicIntroductionList/component.topic-introduction.scss +0 -111
- package/src/TopicIntroductionList/component.topic-shortcuts.scss +0 -90
- package/src/TopicIntroductionList/index.ts +0 -11
package/lib/index.d.ts
CHANGED
|
@@ -10,9 +10,8 @@ export * from './index-javascript';
|
|
|
10
10
|
export { default as SectionHeading } from './SectionHeading';
|
|
11
11
|
export { ArticleByline, ArticleContent, ArticleFootNotes, ArticleIntroduction, ArticleTitle, ArticleWrapper, ArticleHeaderWrapper, ArticleSideBar, default as Article, } from './Article';
|
|
12
12
|
export { CompetenceGoalsDialog } from './CompetenceGoals';
|
|
13
|
-
export { default as TopicIntroductionList } from './TopicIntroductionList';
|
|
14
13
|
export { default as Table } from './Table';
|
|
15
|
-
export { default as ResourcesWrapper,
|
|
14
|
+
export { default as ResourcesWrapper, ResourcesTopicTitle } from './ResourcesWrapper';
|
|
16
15
|
export { createUniversalPortal } from './utils/createUniversalPortal';
|
|
17
16
|
export { default as NoContentBox } from './NoContentBox';
|
|
18
17
|
export { default as Masthead, MastheadItem, getMastheadHeight, useMastheadHeight, SkipToMainContent } from './Masthead';
|
|
@@ -78,7 +77,7 @@ export { FilmSlideshow, MovieGrid, AboutNdlaFilm, FilmMovieSearch, FilmMovieList
|
|
|
78
77
|
export { DisplayOnPageYOffset } from './Animation';
|
|
79
78
|
export { MediaList, MediaListItem, MediaListItemBody, MediaListItemActions, MediaListItemImage, MediaListItemMeta, } from './MediaList';
|
|
80
79
|
export { default as ContentTypeBadge, SubjectMaterialBadge, TasksAndActivitiesBadge, AssessmentResourcesBadge, LearningPathBadge, SubjectBadge, ExternalLearningResourcesBadge, SourceMaterialBadge, } from './ContentTypeBadge';
|
|
81
|
-
export {
|
|
80
|
+
export { SubjectChildContent, SubjectContent, SubjectFlexWrapper, SubjectHeader, SubjectNewContent, SubjectSecondaryContent, SubjectSectionTitle, SubjectSidebarWrapper, SubjectSocialContent, SubjectSocialSection, SubjectTopics, SubjectBanner, } from './Subject';
|
|
82
81
|
export { default as ContentCard } from './ContentCard';
|
|
83
82
|
export { default as CopyParagraphButton } from './CopyParagraphButton';
|
|
84
83
|
export { default as ContentPlaceholder } from './ContentPlaceholder';
|
package/lib/index.js
CHANGED
|
@@ -16,10 +16,8 @@ var _exportNames = {
|
|
|
16
16
|
ArticleSideBar: true,
|
|
17
17
|
Article: true,
|
|
18
18
|
CompetenceGoalsDialog: true,
|
|
19
|
-
TopicIntroductionList: true,
|
|
20
19
|
Table: true,
|
|
21
20
|
ResourcesWrapper: true,
|
|
22
|
-
ResourcesTitle: true,
|
|
23
21
|
ResourcesTopicTitle: true,
|
|
24
22
|
createUniversalPortal: true,
|
|
25
23
|
NoContentBox: true,
|
|
@@ -160,19 +158,13 @@ var _exportNames = {
|
|
|
160
158
|
SubjectBadge: true,
|
|
161
159
|
ExternalLearningResourcesBadge: true,
|
|
162
160
|
SourceMaterialBadge: true,
|
|
163
|
-
SubjectAbout: true,
|
|
164
|
-
SubjectArchive: true,
|
|
165
|
-
SubjectCarousel: true,
|
|
166
161
|
SubjectChildContent: true,
|
|
167
162
|
SubjectContent: true,
|
|
168
|
-
SubjectFlexChild: true,
|
|
169
163
|
SubjectFlexWrapper: true,
|
|
170
164
|
SubjectHeader: true,
|
|
171
|
-
SubjectLinks: true,
|
|
172
165
|
SubjectNewContent: true,
|
|
173
166
|
SubjectSecondaryContent: true,
|
|
174
167
|
SubjectSectionTitle: true,
|
|
175
|
-
SubjectShortcuts: true,
|
|
176
168
|
SubjectSidebarWrapper: true,
|
|
177
169
|
SubjectSocialContent: true,
|
|
178
170
|
SubjectSocialSection: true,
|
|
@@ -964,12 +956,6 @@ Object.defineProperty(exports, "ResourceGroup", {
|
|
|
964
956
|
return _ResourceGroup["default"];
|
|
965
957
|
}
|
|
966
958
|
});
|
|
967
|
-
Object.defineProperty(exports, "ResourcesTitle", {
|
|
968
|
-
enumerable: true,
|
|
969
|
-
get: function get() {
|
|
970
|
-
return _ResourcesWrapper.ResourcesTitle;
|
|
971
|
-
}
|
|
972
|
-
});
|
|
973
959
|
Object.defineProperty(exports, "ResourcesTopicTitle", {
|
|
974
960
|
enumerable: true,
|
|
975
961
|
get: function get() {
|
|
@@ -1078,18 +1064,6 @@ Object.defineProperty(exports, "SourceMaterialHero", {
|
|
|
1078
1064
|
return _Hero.SourceMaterialHero;
|
|
1079
1065
|
}
|
|
1080
1066
|
});
|
|
1081
|
-
Object.defineProperty(exports, "SubjectAbout", {
|
|
1082
|
-
enumerable: true,
|
|
1083
|
-
get: function get() {
|
|
1084
|
-
return _Subject.SubjectAbout;
|
|
1085
|
-
}
|
|
1086
|
-
});
|
|
1087
|
-
Object.defineProperty(exports, "SubjectArchive", {
|
|
1088
|
-
enumerable: true,
|
|
1089
|
-
get: function get() {
|
|
1090
|
-
return _Subject.SubjectArchive;
|
|
1091
|
-
}
|
|
1092
|
-
});
|
|
1093
1067
|
Object.defineProperty(exports, "SubjectBadge", {
|
|
1094
1068
|
enumerable: true,
|
|
1095
1069
|
get: function get() {
|
|
@@ -1102,12 +1076,6 @@ Object.defineProperty(exports, "SubjectBanner", {
|
|
|
1102
1076
|
return _Subject.SubjectBanner;
|
|
1103
1077
|
}
|
|
1104
1078
|
});
|
|
1105
|
-
Object.defineProperty(exports, "SubjectCarousel", {
|
|
1106
|
-
enumerable: true,
|
|
1107
|
-
get: function get() {
|
|
1108
|
-
return _Subject.SubjectCarousel;
|
|
1109
|
-
}
|
|
1110
|
-
});
|
|
1111
1079
|
Object.defineProperty(exports, "SubjectChildContent", {
|
|
1112
1080
|
enumerable: true,
|
|
1113
1081
|
get: function get() {
|
|
@@ -1120,12 +1088,6 @@ Object.defineProperty(exports, "SubjectContent", {
|
|
|
1120
1088
|
return _Subject.SubjectContent;
|
|
1121
1089
|
}
|
|
1122
1090
|
});
|
|
1123
|
-
Object.defineProperty(exports, "SubjectFlexChild", {
|
|
1124
|
-
enumerable: true,
|
|
1125
|
-
get: function get() {
|
|
1126
|
-
return _Subject.SubjectFlexChild;
|
|
1127
|
-
}
|
|
1128
|
-
});
|
|
1129
1091
|
Object.defineProperty(exports, "SubjectFlexWrapper", {
|
|
1130
1092
|
enumerable: true,
|
|
1131
1093
|
get: function get() {
|
|
@@ -1144,12 +1106,6 @@ Object.defineProperty(exports, "SubjectHero", {
|
|
|
1144
1106
|
return _Hero.SubjectHero;
|
|
1145
1107
|
}
|
|
1146
1108
|
});
|
|
1147
|
-
Object.defineProperty(exports, "SubjectLinks", {
|
|
1148
|
-
enumerable: true,
|
|
1149
|
-
get: function get() {
|
|
1150
|
-
return _Subject.SubjectLinks;
|
|
1151
|
-
}
|
|
1152
|
-
});
|
|
1153
1109
|
Object.defineProperty(exports, "SubjectMaterialBadge", {
|
|
1154
1110
|
enumerable: true,
|
|
1155
1111
|
get: function get() {
|
|
@@ -1180,12 +1136,6 @@ Object.defineProperty(exports, "SubjectSectionTitle", {
|
|
|
1180
1136
|
return _Subject.SubjectSectionTitle;
|
|
1181
1137
|
}
|
|
1182
1138
|
});
|
|
1183
|
-
Object.defineProperty(exports, "SubjectShortcuts", {
|
|
1184
|
-
enumerable: true,
|
|
1185
|
-
get: function get() {
|
|
1186
|
-
return _Subject.SubjectShortcuts;
|
|
1187
|
-
}
|
|
1188
|
-
});
|
|
1189
1139
|
Object.defineProperty(exports, "SubjectSidebarWrapper", {
|
|
1190
1140
|
enumerable: true,
|
|
1191
1141
|
get: function get() {
|
|
@@ -1258,12 +1208,6 @@ Object.defineProperty(exports, "Topic", {
|
|
|
1258
1208
|
return _Topic["default"];
|
|
1259
1209
|
}
|
|
1260
1210
|
});
|
|
1261
|
-
Object.defineProperty(exports, "TopicIntroductionList", {
|
|
1262
|
-
enumerable: true,
|
|
1263
|
-
get: function get() {
|
|
1264
|
-
return _TopicIntroductionList["default"];
|
|
1265
|
-
}
|
|
1266
|
-
});
|
|
1267
1211
|
Object.defineProperty(exports, "Translation", {
|
|
1268
1212
|
enumerable: true,
|
|
1269
1213
|
get: function get() {
|
|
@@ -1393,7 +1337,6 @@ Object.keys(_indexJavascript).forEach(function (key) {
|
|
|
1393
1337
|
var _SectionHeading = _interopRequireDefault(require("./SectionHeading"));
|
|
1394
1338
|
var _Article = _interopRequireWildcard(require("./Article"));
|
|
1395
1339
|
var _CompetenceGoals = require("./CompetenceGoals");
|
|
1396
|
-
var _TopicIntroductionList = _interopRequireDefault(require("./TopicIntroductionList"));
|
|
1397
1340
|
var _Table = _interopRequireDefault(require("./Table"));
|
|
1398
1341
|
var _ResourcesWrapper = _interopRequireWildcard(require("./ResourcesWrapper"));
|
|
1399
1342
|
var _createUniversalPortal = require("./utils/createUniversalPortal");
|
|
@@ -325,7 +325,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
325
325
|
subjectOverview: 'All subjects',
|
|
326
326
|
modalLabel: 'Choose content',
|
|
327
327
|
backToSubjectFrontpage: 'Back to subject frontpage',
|
|
328
|
-
title: '
|
|
328
|
+
title: 'Open menu',
|
|
329
329
|
subjectPage: 'Subject front page',
|
|
330
330
|
openFilter: 'Filter',
|
|
331
331
|
useFilter: 'Use filter',
|
|
@@ -323,7 +323,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
323
323
|
search: 'Søk',
|
|
324
324
|
toFrontpage: 'Til forsiden',
|
|
325
325
|
subjectOverview: 'Alle fag',
|
|
326
|
-
title: '
|
|
326
|
+
title: 'Åpne meny',
|
|
327
327
|
modalLabel: 'Velg innhold',
|
|
328
328
|
subjectPage: 'Fagforside',
|
|
329
329
|
backToSubjectFrontpage: 'Tilbake til fagforsiden',
|
|
@@ -582,7 +582,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
582
582
|
editorInChief: 'Ansvarlig redaktør: ',
|
|
583
583
|
managingEditor: 'Utgaveansvarlig: ',
|
|
584
584
|
privacyLink: 'Personvernerklæring',
|
|
585
|
-
cookiesLink: 'Erklæring om
|
|
585
|
+
cookiesLink: 'Erklæring om informasjonskapsler',
|
|
586
586
|
socialMediaLinks: {
|
|
587
587
|
facebook: 'NDLA på Facebook',
|
|
588
588
|
facebookAria: 'Besøk NDLA på Facebook',
|
|
@@ -323,7 +323,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
323
323
|
search: 'Søk',
|
|
324
324
|
toFrontpage: 'Til framsida',
|
|
325
325
|
subjectOverview: 'Alle fag',
|
|
326
|
-
title: '
|
|
326
|
+
title: 'Åpne meny',
|
|
327
327
|
modalLabel: 'Vel innhald',
|
|
328
328
|
subjectPage: 'Fagframside',
|
|
329
329
|
backToSubjectFrontpage: 'Tilbake til fagframsida',
|
|
@@ -323,7 +323,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
323
323
|
search: 'Oza',
|
|
324
324
|
toFrontpage: 'Ovdasiidui',
|
|
325
325
|
subjectOverview: 'Buot fágat',
|
|
326
|
-
title: '
|
|
326
|
+
title: 'Åpne meny',
|
|
327
327
|
modalLabel: 'Vállje sisdoalu',
|
|
328
328
|
subjectPage: 'Ovdasiidu fágas',
|
|
329
329
|
backToSubjectFrontpage: 'Ruovttoluotta fága ovdasiidui',
|
|
@@ -323,7 +323,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
323
323
|
search: 'Søk',
|
|
324
324
|
toFrontpage: 'Til forsiden',
|
|
325
325
|
subjectOverview: 'Alle fag',
|
|
326
|
-
title: '
|
|
326
|
+
title: 'Åpne meny',
|
|
327
327
|
modalLabel: 'Velg innhold',
|
|
328
328
|
subjectPage: 'Fagforside',
|
|
329
329
|
backToSubjectFrontpage: 'Tilbake til fagforsiden',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "33.0.
|
|
3
|
+
"version": "33.0.7",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ndla/article-scripts": "^3.0.12",
|
|
35
|
-
"@ndla/button": "^6.1.
|
|
35
|
+
"@ndla/button": "^6.1.2",
|
|
36
36
|
"@ndla/carousel": "^2.1.0",
|
|
37
37
|
"@ndla/core": "^3.0.3",
|
|
38
|
-
"@ndla/forms": "^4.1.
|
|
38
|
+
"@ndla/forms": "^4.1.3",
|
|
39
39
|
"@ndla/hooks": "^1.2.0",
|
|
40
40
|
"@ndla/icons": "^2.1.0",
|
|
41
41
|
"@ndla/licenses": "^6.1.1",
|
|
42
42
|
"@ndla/modal": "^2.2.1",
|
|
43
|
-
"@ndla/notion": "^4.1.
|
|
44
|
-
"@ndla/safelink": "^3.1.
|
|
43
|
+
"@ndla/notion": "^4.1.4",
|
|
44
|
+
"@ndla/safelink": "^3.1.3",
|
|
45
45
|
"@ndla/switch": "^1.0.3",
|
|
46
46
|
"@ndla/tabs": "^2.1.0",
|
|
47
47
|
"@ndla/tooltip": "^3.1.1",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "ea860e9b36dfe3e7757e649b72bdbc8e7f9d22b4"
|
|
87
87
|
}
|
|
@@ -25,12 +25,18 @@ const StyledPrivacyLink = styled.a`
|
|
|
25
25
|
box-shadow: ${misc.textLinkBoxShadow};
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
margin-bottom: ${spacing.large};
|
|
28
|
-
margin-left: ${spacing.small};
|
|
29
28
|
&:hover,
|
|
30
29
|
&:focus {
|
|
31
30
|
box-shadow: none;
|
|
32
31
|
}
|
|
33
32
|
`;
|
|
33
|
+
|
|
34
|
+
const StyledLinkSpacer = styled.span`
|
|
35
|
+
margin-left: ${spacing.xxsmall};
|
|
36
|
+
margin-right: ${spacing.xxsmall};
|
|
37
|
+
margin-bottom: ${spacing.large};
|
|
38
|
+
`;
|
|
39
|
+
|
|
34
40
|
const StyledFooterText = styled.div`
|
|
35
41
|
display: flex;
|
|
36
42
|
flex-direction: row;
|
|
@@ -57,10 +63,13 @@ const StyledFooterText = styled.div`
|
|
|
57
63
|
const FooterPrivacy = ({ privacyLinks }: FooterPrivacyProps) => {
|
|
58
64
|
return (
|
|
59
65
|
<StyledFooterText>
|
|
60
|
-
{privacyLinks.map((link) => (
|
|
61
|
-
|
|
62
|
-
{
|
|
63
|
-
|
|
66
|
+
{privacyLinks.map((link, index) => (
|
|
67
|
+
<>
|
|
68
|
+
{index > 0 && <StyledLinkSpacer aria-hidden>|</StyledLinkSpacer>}
|
|
69
|
+
<StyledPrivacyLink href={link.url} key={link.label}>
|
|
70
|
+
{link.label}
|
|
71
|
+
</StyledPrivacyLink>
|
|
72
|
+
</>
|
|
64
73
|
))}
|
|
65
74
|
</StyledFooterText>
|
|
66
75
|
);
|
package/src/Image/Image.tsx
CHANGED
package/src/Image/ImageLink.tsx
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
exports[`Image renderers correctly 1`] = `
|
|
4
4
|
.emotion-0 {
|
|
5
5
|
position: relative;
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
<div
|
|
@@ -26,8 +24,6 @@ exports[`Image renderers correctly 1`] = `
|
|
|
26
24
|
exports[`Image with crop and focalpoint props renderers correctly 1`] = `
|
|
27
25
|
.emotion-0 {
|
|
28
26
|
position: relative;
|
|
29
|
-
width: 100%;
|
|
30
|
-
height: 100%;
|
|
31
27
|
}
|
|
32
28
|
|
|
33
29
|
<div
|
|
@@ -49,8 +45,6 @@ exports[`Image with crop and focalpoint props renderers correctly 1`] = `
|
|
|
49
45
|
exports[`Lazyloaded image renderers correctly 1`] = `
|
|
50
46
|
.emotion-0 {
|
|
51
47
|
position: relative;
|
|
52
|
-
width: 100%;
|
|
53
|
-
height: 100%;
|
|
54
48
|
}
|
|
55
49
|
|
|
56
50
|
<div
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
10
10
|
import { useArgs } from '@storybook/client-api';
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import { defaultParameters } from '
|
|
12
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
13
13
|
import LetterFilter from './LetterFilter';
|
|
14
14
|
|
|
15
15
|
export default {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
|
2
|
-
import { defaultParameters } from '
|
|
2
|
+
import { defaultParameters } from '../../../../../stories/defaults';
|
|
3
3
|
import { Pencil } from '@ndla/icons/action';
|
|
4
4
|
import { DeleteForever } from '@ndla/icons/editor';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
|
2
|
-
import { defaultParameters } from '
|
|
2
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
3
3
|
import { Pencil } from '@ndla/icons/action';
|
|
4
4
|
import { DeleteForever } from '@ndla/icons/editor';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
|
2
|
-
import { defaultParameters } from '
|
|
2
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
3
3
|
import { Pencil } from '@ndla/icons/action';
|
|
4
4
|
import { DeleteForever } from '@ndla/icons/editor';
|
|
5
5
|
|
|
@@ -1,22 +1,60 @@
|
|
|
1
1
|
import React, { Fragment, ReactNode } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { css } from '@emotion/react';
|
|
3
4
|
import styled from '@emotion/styled';
|
|
4
|
-
import { spacing } from '@ndla/core';
|
|
5
|
-
import { HelpCircleDual } from '@ndla/icons/common';
|
|
5
|
+
import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
|
|
6
6
|
import Modal, { ModalBody, ModalHeader, ModalCloseButton } from '@ndla/modal';
|
|
7
7
|
import Tooltip from '@ndla/tooltip';
|
|
8
8
|
import { Switch } from '@ndla/switch';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { classes } from './ResourcesWrapper';
|
|
9
|
+
import { LearningPathQuiz } from '@ndla/icons/contentType';
|
|
12
10
|
|
|
13
11
|
interface HelpIconProps {
|
|
14
12
|
invertedStyle: boolean;
|
|
15
13
|
}
|
|
14
|
+
|
|
15
|
+
const StyledTopicTitleIcon = styled.div`
|
|
16
|
+
color: ${colors.brand.light};
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
justify-content: flex-end;
|
|
19
|
+
border: 0;
|
|
20
|
+
display: flex;
|
|
21
|
+
padding: 5px;
|
|
22
|
+
border-radius: 100%;
|
|
23
|
+
align-items: center;
|
|
24
|
+
outline: 0;
|
|
25
|
+
background-color: ${colors.brand.light};
|
|
26
|
+
svg {
|
|
27
|
+
fill: ${colors.brand.primary};
|
|
28
|
+
height: 10px;
|
|
29
|
+
width: 10px;
|
|
30
|
+
}
|
|
31
|
+
&:hover,
|
|
32
|
+
&:focus {
|
|
33
|
+
background-color: ${colors.brand.primary};
|
|
34
|
+
svg {
|
|
35
|
+
fill: ${colors.white};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const invertedTopicTitleIconStyle = css`
|
|
41
|
+
background-color: ${colors.white};
|
|
42
|
+
svg {
|
|
43
|
+
fill: ${colors.brand.primary};
|
|
44
|
+
}
|
|
45
|
+
&:hover,
|
|
46
|
+
&:focus {
|
|
47
|
+
background-color: ${colors.white};
|
|
48
|
+
svg: {
|
|
49
|
+
fill: ${colors.brand.primary};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
|
|
16
54
|
const HelpIcon = ({ invertedStyle }: HelpIconProps) => (
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
</
|
|
55
|
+
<StyledTopicTitleIcon css={invertedStyle ? invertedTopicTitleIconStyle : undefined}>
|
|
56
|
+
<LearningPathQuiz />
|
|
57
|
+
</StyledTopicTitleIcon>
|
|
20
58
|
);
|
|
21
59
|
|
|
22
60
|
const switchCSS = css`
|
|
@@ -39,6 +77,71 @@ const TooltipButton = styled.button`
|
|
|
39
77
|
cursor: pointer;
|
|
40
78
|
`;
|
|
41
79
|
|
|
80
|
+
const StyledTopicTitleParagraph = styled.p`
|
|
81
|
+
font-family: ${fonts.sans};
|
|
82
|
+
${fonts.sizes('18px', '24px')};
|
|
83
|
+
font-weight: ${fonts.weight.bold};
|
|
84
|
+
text-transform: uppercase;
|
|
85
|
+
letter-spacing: 0.05em;
|
|
86
|
+
margin: 0 ${spacing.xsmall} 0 0;
|
|
87
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
88
|
+
margin-right: ${spacing.small};
|
|
89
|
+
${fonts.sizes('20px', '26px')};
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
const TopicTitleWrapper = styled.header`
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
flex-flow: wrap;
|
|
96
|
+
align-items: center;
|
|
97
|
+
margin-top: ${spacing.large};
|
|
98
|
+
padding-bottom: ${spacing.small};
|
|
99
|
+
width: 100%;
|
|
100
|
+
flex-direction: row;
|
|
101
|
+
justify-content: space-between;
|
|
102
|
+
align-items: center;
|
|
103
|
+
> div {
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
flex-wrap: wrap;
|
|
106
|
+
align-items: center;
|
|
107
|
+
&:last-child {
|
|
108
|
+
padding: ${spacing.xsmall} 0;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
${mq.range({ until: breakpoints.mobileWide })} {
|
|
112
|
+
> div {
|
|
113
|
+
display: block;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
${mq.range({ until: breakpoints.tablet })} {
|
|
117
|
+
display: block;
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
const invertedTopicTitleWrapperStyle = css`
|
|
122
|
+
color: #fff;
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
const TopicTitle = styled.h1`
|
|
126
|
+
font-weight: ${fonts.weight.normal};
|
|
127
|
+
margin: 0;
|
|
128
|
+
${fonts.sizes('18px', '24px')};
|
|
129
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
130
|
+
${fonts.sizes('20px', '26px')};
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
|
|
134
|
+
const topicTitleSingleStyle = css`
|
|
135
|
+
font-weight: ${fonts.weight.bold};
|
|
136
|
+
text-transform: uppercase;
|
|
137
|
+
`;
|
|
138
|
+
|
|
139
|
+
const StyledRow = styled.div`
|
|
140
|
+
display: flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
gap: ${spacing.xsmall};
|
|
143
|
+
`;
|
|
144
|
+
|
|
42
145
|
interface Props {
|
|
43
146
|
title?: string;
|
|
44
147
|
toggleAdditionalResources: () => void;
|
|
@@ -62,21 +165,21 @@ const ResourcesTopicTitle = ({
|
|
|
62
165
|
// Fix for heading while title not required when ready.
|
|
63
166
|
let heading;
|
|
64
167
|
if (title) {
|
|
65
|
-
heading = <
|
|
168
|
+
heading = <TopicTitle>{title}</TopicTitle>;
|
|
66
169
|
} else {
|
|
67
|
-
heading = <
|
|
170
|
+
heading = <TopicTitle css={topicTitleSingleStyle}>{messages.label}</TopicTitle>;
|
|
68
171
|
}
|
|
69
172
|
|
|
70
173
|
const tooltipId = 'popupDialogTooltip';
|
|
71
174
|
|
|
72
175
|
return (
|
|
73
|
-
<
|
|
176
|
+
<TopicTitleWrapper css={invertedStyle ? invertedTopicTitleWrapperStyle : undefined}>
|
|
74
177
|
<div>
|
|
75
|
-
{title && <
|
|
178
|
+
{title && <StyledTopicTitleParagraph>{messages.label}</StyledTopicTitleParagraph>}
|
|
76
179
|
{heading}
|
|
77
180
|
</div>
|
|
78
181
|
{hasAdditionalResources && (
|
|
79
|
-
<
|
|
182
|
+
<StyledRow>
|
|
80
183
|
<Switch
|
|
81
184
|
id="toggleAdditionID"
|
|
82
185
|
checked={showAdditionalResources}
|
|
@@ -111,9 +214,9 @@ const ResourcesTopicTitle = ({
|
|
|
111
214
|
</>
|
|
112
215
|
)}
|
|
113
216
|
</Modal>
|
|
114
|
-
</
|
|
217
|
+
</StyledRow>
|
|
115
218
|
)}
|
|
116
|
-
</
|
|
219
|
+
</TopicTitleWrapper>
|
|
117
220
|
);
|
|
118
221
|
};
|
|
119
222
|
|
|
@@ -6,26 +6,27 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React, { ReactNode } from 'react';
|
|
10
|
-
import
|
|
9
|
+
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
10
|
+
import styled from '@emotion/styled';
|
|
11
|
+
import { spacing } from '@ndla/core';
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
name: 'resources',
|
|
14
|
-
prefix: 'c-',
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
interface Props {
|
|
13
|
+
interface Props extends HTMLAttributes<HTMLElement> {
|
|
18
14
|
header?: ReactNode;
|
|
19
15
|
children: ReactNode;
|
|
20
|
-
|
|
16
|
+
className?: string;
|
|
21
17
|
id?: string;
|
|
22
18
|
}
|
|
23
19
|
|
|
24
|
-
const
|
|
25
|
-
|
|
20
|
+
const StyledSection = styled.section`
|
|
21
|
+
padding-top: ${spacing.normal};
|
|
22
|
+
padding-bottom: ${spacing.normal};
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const ResourcesWrapper = ({ children, header, ...rest }: Props) => (
|
|
26
|
+
<StyledSection {...rest}>
|
|
26
27
|
{header}
|
|
27
|
-
|
|
28
|
-
</
|
|
28
|
+
{children}
|
|
29
|
+
</StyledSection>
|
|
29
30
|
);
|
|
30
31
|
|
|
31
32
|
export default ResourcesWrapper;
|
|
@@ -99,6 +99,7 @@ const ImageWrapper = styled.div<{ isTopic: boolean }>`
|
|
|
99
99
|
margin: ${spacing.small};
|
|
100
100
|
overflow: hidden;
|
|
101
101
|
${(props) => props.isTopic && `border-radius: 50%;`};
|
|
102
|
+
-webkit-mask-image: -webkit-radial-gradient(white, black);
|
|
102
103
|
`;
|
|
103
104
|
|
|
104
105
|
const ImageElement = styled.img`
|
package/src/Subject/Subject.tsx
CHANGED
|
@@ -179,10 +179,6 @@ const StyledSubjectFlexChild = styled.div`
|
|
|
179
179
|
}
|
|
180
180
|
`;
|
|
181
181
|
|
|
182
|
-
export const SubjectFlexChild = ({ children }: { children: ReactNode }) => (
|
|
183
|
-
<StyledSubjectFlexChild>{children}</StyledSubjectFlexChild>
|
|
184
|
-
);
|
|
185
|
-
|
|
186
182
|
const StyledSectionHeading = styled(SectionHeading)`
|
|
187
183
|
margin: 0 0 ${spacing.small} 0;
|
|
188
184
|
|
package/src/Subject/index.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export { default as SubjectHeader } from './SubjectHeader';
|
|
2
|
-
export { default as SubjectShortcuts } from './SubjectShortcuts';
|
|
3
|
-
export { default as SubjectLinks } from './SubjectLinks';
|
|
4
|
-
export { default as SubjectArchive } from './SubjectArchive';
|
|
5
|
-
export { default as SubjectAbout } from './SubjectAbout';
|
|
6
|
-
export { default as SubjectCarousel } from './SubjectCarousel';
|
|
7
2
|
export { default as SubjectNewContent } from './SubjectNewContent';
|
|
8
3
|
export { default as SubjectBanner } from './SubjectBanner';
|
|
9
4
|
|
|
@@ -12,7 +7,6 @@ export {
|
|
|
12
7
|
SubjectTopics,
|
|
13
8
|
SubjectSidebarWrapper,
|
|
14
9
|
SubjectFlexWrapper,
|
|
15
|
-
SubjectFlexChild,
|
|
16
10
|
SubjectSectionTitle,
|
|
17
11
|
SubjectChildContent,
|
|
18
12
|
SubjectSecondaryContent,
|
package/src/index.ts
CHANGED
|
@@ -28,11 +28,9 @@ export {
|
|
|
28
28
|
|
|
29
29
|
export { CompetenceGoalsDialog } from './CompetenceGoals';
|
|
30
30
|
|
|
31
|
-
export { default as TopicIntroductionList } from './TopicIntroductionList';
|
|
32
|
-
|
|
33
31
|
export { default as Table } from './Table';
|
|
34
32
|
|
|
35
|
-
export { default as ResourcesWrapper,
|
|
33
|
+
export { default as ResourcesWrapper, ResourcesTopicTitle } from './ResourcesWrapper';
|
|
36
34
|
|
|
37
35
|
export { createUniversalPortal } from './utils/createUniversalPortal';
|
|
38
36
|
|
|
@@ -213,19 +211,13 @@ export {
|
|
|
213
211
|
} from './ContentTypeBadge';
|
|
214
212
|
|
|
215
213
|
export {
|
|
216
|
-
SubjectAbout,
|
|
217
|
-
SubjectArchive,
|
|
218
|
-
SubjectCarousel,
|
|
219
214
|
SubjectChildContent,
|
|
220
215
|
SubjectContent,
|
|
221
|
-
SubjectFlexChild,
|
|
222
216
|
SubjectFlexWrapper,
|
|
223
217
|
SubjectHeader,
|
|
224
|
-
SubjectLinks,
|
|
225
218
|
SubjectNewContent,
|
|
226
219
|
SubjectSecondaryContent,
|
|
227
220
|
SubjectSectionTitle,
|
|
228
|
-
SubjectShortcuts,
|
|
229
221
|
SubjectSidebarWrapper,
|
|
230
222
|
SubjectSocialContent,
|
|
231
223
|
SubjectSocialSection,
|