@ndla/ui 3.3.13 → 3.3.14

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 (91) hide show
  1. package/es/Figure/Figure.js +3 -1
  2. package/es/NDLAFilm/AboutNdlaFilm.js +6 -17
  3. package/es/NDLAFilm/AllMoviesAlphabetically.js +11 -11
  4. package/es/NDLAFilm/CategorySelect.js +17 -18
  5. package/es/NDLAFilm/FilmContentCard.js +8 -22
  6. package/es/NDLAFilm/FilmContentCardTags.js +4 -8
  7. package/es/NDLAFilm/FilmMovieList.js +6 -21
  8. package/es/NDLAFilm/FilmMovieSearch.js +18 -26
  9. package/es/NDLAFilm/MovieGrid.js +10 -19
  10. package/es/NDLAFilm/VisualElement.js +22 -29
  11. package/es/TopicIntroductionList/TopicIntroduction.js +14 -33
  12. package/es/TopicIntroductionList/TopicIntroductionList.js +6 -23
  13. package/es/TopicIntroductionList/TopicIntroductionShortcuts.js +71 -110
  14. package/es/TopicIntroductionList/TopicShortcutItem.js +0 -9
  15. package/es/all.css +1 -4
  16. package/es/index-javascript.js +1 -5
  17. package/es/index.js +4 -0
  18. package/es/shapes.js +0 -6
  19. package/lib/Figure/Figure.js +3 -1
  20. package/lib/NDLAFilm/AboutNdlaFilm.d.ts +15 -0
  21. package/lib/NDLAFilm/AboutNdlaFilm.js +6 -18
  22. package/lib/NDLAFilm/AllMoviesAlphabetically.d.ts +2 -2
  23. package/lib/NDLAFilm/AllMoviesAlphabetically.js +11 -11
  24. package/lib/NDLAFilm/CategorySelect.d.ts +11 -0
  25. package/lib/NDLAFilm/CategorySelect.js +20 -19
  26. package/lib/NDLAFilm/FilmContentCard.d.ts +11 -0
  27. package/lib/NDLAFilm/FilmContentCard.js +8 -23
  28. package/lib/NDLAFilm/FilmContentCardTags.d.ts +7 -0
  29. package/lib/NDLAFilm/FilmContentCardTags.js +4 -9
  30. package/lib/NDLAFilm/FilmMovieList.d.ts +19 -0
  31. package/lib/NDLAFilm/FilmMovieList.js +5 -21
  32. package/lib/NDLAFilm/FilmMovieSearch.d.ts +21 -0
  33. package/lib/NDLAFilm/FilmMovieSearch.js +25 -30
  34. package/lib/NDLAFilm/FilmSlideshow.d.ts +5 -5
  35. package/lib/NDLAFilm/MovieGrid.d.ts +13 -0
  36. package/lib/NDLAFilm/MovieGrid.js +9 -21
  37. package/lib/NDLAFilm/SlideshowIndicator.d.ts +2 -2
  38. package/lib/NDLAFilm/VisualElement.d.ts +16 -0
  39. package/lib/NDLAFilm/VisualElement.js +22 -30
  40. package/lib/NDLAFilm/index.d.ts +14 -0
  41. package/lib/NDLAFilm/types.d.ts +6 -4
  42. package/lib/TopicIntroductionList/TopicIntroduction.d.ts +21 -0
  43. package/lib/TopicIntroductionList/TopicIntroduction.js +16 -36
  44. package/lib/TopicIntroductionList/TopicIntroductionList.d.ts +35 -0
  45. package/lib/TopicIntroductionList/TopicIntroductionList.js +6 -25
  46. package/lib/TopicIntroductionList/TopicIntroductionShortcuts.d.ts +8 -0
  47. package/lib/TopicIntroductionList/TopicIntroductionShortcuts.js +72 -110
  48. package/lib/TopicIntroductionList/TopicShortcutItem.d.ts +6 -0
  49. package/lib/TopicIntroductionList/TopicShortcutItem.js +0 -11
  50. package/lib/TopicIntroductionList/index.d.ts +9 -0
  51. package/lib/all.css +1 -4
  52. package/lib/index-javascript.js +3 -137
  53. package/lib/index.d.ts +4 -0
  54. package/lib/index.js +155 -0
  55. package/lib/shapes.js +1 -10
  56. package/package.json +10 -10
  57. package/src/Figure/Figure.tsx +2 -1
  58. package/src/Figure/component.figure.scss +37 -3
  59. package/src/NDLAFilm/{AboutNdlaFilm.jsx → AboutNdlaFilm.tsx} +19 -18
  60. package/src/NDLAFilm/AllMoviesAlphabetically.tsx +3 -3
  61. package/src/NDLAFilm/{CategorySelect.jsx → CategorySelect.tsx} +23 -20
  62. package/src/NDLAFilm/{FilmContentCard.jsx → FilmContentCard.tsx} +21 -21
  63. package/src/NDLAFilm/{FilmContentCardTags.jsx → FilmContentCardTags.tsx} +7 -7
  64. package/src/NDLAFilm/{FilmMovieList.jsx → FilmMovieList.tsx} +17 -27
  65. package/src/NDLAFilm/FilmMovieSearch.tsx +71 -0
  66. package/src/NDLAFilm/FilmSlideshow.tsx +6 -6
  67. package/src/NDLAFilm/MovieGrid.tsx +76 -0
  68. package/src/NDLAFilm/SlideshowIndicator.tsx +2 -2
  69. package/src/NDLAFilm/VisualElement.tsx +40 -0
  70. package/src/NDLAFilm/{index.js → index.ts} +0 -0
  71. package/src/NDLAFilm/types.ts +7 -4
  72. package/src/TopicIntroductionList/{TopicIntroduction.jsx → TopicIntroduction.tsx} +22 -35
  73. package/src/TopicIntroductionList/{TopicIntroductionList.jsx → TopicIntroductionList.tsx} +32 -26
  74. package/src/TopicIntroductionList/TopicIntroductionShortcuts.tsx +71 -0
  75. package/src/TopicIntroductionList/{TopicShortcutItem.jsx → TopicShortcutItem.tsx} +5 -13
  76. package/src/TopicIntroductionList/{index.js → index.ts} +0 -0
  77. package/src/index-javascript.js +0 -30
  78. package/src/index.ts +31 -0
  79. package/src/shapes.js +0 -7
  80. package/es/NDLAFilm/interfaces.js +0 -0
  81. package/es/NDLAFilm/shapes.js +0 -15
  82. package/lib/NDLAFilm/interfaces.d.ts +0 -10
  83. package/lib/NDLAFilm/interfaces.js +0 -1
  84. package/lib/NDLAFilm/shapes.d.ts +0 -15
  85. package/lib/NDLAFilm/shapes.js +0 -30
  86. package/src/NDLAFilm/FilmMovieSearch.jsx +0 -66
  87. package/src/NDLAFilm/MovieGrid.jsx +0 -75
  88. package/src/NDLAFilm/VisualElement.jsx +0 -48
  89. package/src/NDLAFilm/interfaces.ts +0 -10
  90. package/src/NDLAFilm/shapes.ts +0 -17
  91. package/src/TopicIntroductionList/TopicIntroductionShortcuts.jsx +0 -92
@@ -95,54 +95,6 @@ Object.defineProperty(exports, "ToggleSearchButton", {
95
95
  return _Search.ToggleSearchButton;
96
96
  }
97
97
  });
98
- Object.defineProperty(exports, "ContentTypeBadge", {
99
- enumerable: true,
100
- get: function get() {
101
- return _ContentTypeBadge["default"];
102
- }
103
- });
104
- Object.defineProperty(exports, "SubjectMaterialBadge", {
105
- enumerable: true,
106
- get: function get() {
107
- return _ContentTypeBadge.SubjectMaterialBadge;
108
- }
109
- });
110
- Object.defineProperty(exports, "TasksAndActivitiesBadge", {
111
- enumerable: true,
112
- get: function get() {
113
- return _ContentTypeBadge.TasksAndActivitiesBadge;
114
- }
115
- });
116
- Object.defineProperty(exports, "AssessmentResourcesBadge", {
117
- enumerable: true,
118
- get: function get() {
119
- return _ContentTypeBadge.AssessmentResourcesBadge;
120
- }
121
- });
122
- Object.defineProperty(exports, "LearningPathBadge", {
123
- enumerable: true,
124
- get: function get() {
125
- return _ContentTypeBadge.LearningPathBadge;
126
- }
127
- });
128
- Object.defineProperty(exports, "SubjectBadge", {
129
- enumerable: true,
130
- get: function get() {
131
- return _ContentTypeBadge.SubjectBadge;
132
- }
133
- });
134
- Object.defineProperty(exports, "ExternalLearningResourcesBadge", {
135
- enumerable: true,
136
- get: function get() {
137
- return _ContentTypeBadge.ExternalLearningResourcesBadge;
138
- }
139
- });
140
- Object.defineProperty(exports, "SourceMaterialBadge", {
141
- enumerable: true,
142
- get: function get() {
143
- return _ContentTypeBadge.SourceMaterialBadge;
144
- }
145
- });
146
98
  Object.defineProperty(exports, "TopicIntroductionList", {
147
99
  enumerable: true,
148
100
  get: function get() {
@@ -191,42 +143,6 @@ Object.defineProperty(exports, "CompetenceGoalsDialog", {
191
143
  return _CompetenceGoals.CompetenceGoalsDialog;
192
144
  }
193
145
  });
194
- Object.defineProperty(exports, "MediaList", {
195
- enumerable: true,
196
- get: function get() {
197
- return _MediaList.MediaList;
198
- }
199
- });
200
- Object.defineProperty(exports, "MediaListItem", {
201
- enumerable: true,
202
- get: function get() {
203
- return _MediaList.MediaListItem;
204
- }
205
- });
206
- Object.defineProperty(exports, "MediaListItemBody", {
207
- enumerable: true,
208
- get: function get() {
209
- return _MediaList.MediaListItemBody;
210
- }
211
- });
212
- Object.defineProperty(exports, "MediaListItemActions", {
213
- enumerable: true,
214
- get: function get() {
215
- return _MediaList.MediaListItemActions;
216
- }
217
- });
218
- Object.defineProperty(exports, "MediaListItemImage", {
219
- enumerable: true,
220
- get: function get() {
221
- return _MediaList.MediaListItemImage;
222
- }
223
- });
224
- Object.defineProperty(exports, "MediaListItemMeta", {
225
- enumerable: true,
226
- get: function get() {
227
- return _MediaList.MediaListItemMeta;
228
- }
229
- });
230
146
  Object.defineProperty(exports, "EmbeddedTwitter", {
231
147
  enumerable: true,
232
148
  get: function get() {
@@ -245,71 +161,21 @@ Object.defineProperty(exports, "EmbeddedFacebookPage", {
245
161
  return _Embedded.EmbeddedFacebookPage;
246
162
  }
247
163
  });
248
- Object.defineProperty(exports, "DisplayOnPageYOffset", {
249
- enumerable: true,
250
- get: function get() {
251
- return _Animation.DisplayOnPageYOffset;
252
- }
253
- });
254
- Object.defineProperty(exports, "FilmSlideshow", {
255
- enumerable: true,
256
- get: function get() {
257
- return _NDLAFilm.FilmSlideshow;
258
- }
259
- });
260
- Object.defineProperty(exports, "MovieGrid", {
261
- enumerable: true,
262
- get: function get() {
263
- return _NDLAFilm.MovieGrid;
264
- }
265
- });
266
- Object.defineProperty(exports, "AboutNdlaFilm", {
267
- enumerable: true,
268
- get: function get() {
269
- return _NDLAFilm.AboutNdlaFilm;
270
- }
271
- });
272
- Object.defineProperty(exports, "FilmMovieSearch", {
273
- enumerable: true,
274
- get: function get() {
275
- return _NDLAFilm.FilmMovieSearch;
276
- }
277
- });
278
- Object.defineProperty(exports, "FilmMovieList", {
279
- enumerable: true,
280
- get: function get() {
281
- return _NDLAFilm.FilmMovieList;
282
- }
283
- });
284
- Object.defineProperty(exports, "AllMoviesAlphabetically", {
285
- enumerable: true,
286
- get: function get() {
287
- return _NDLAFilm.AllMoviesAlphabetically;
288
- }
289
- });
290
164
 
291
165
  var _Filter = require("./Filter");
292
166
 
293
167
  var _Search = require("./Search");
294
168
 
295
- var _ContentTypeBadge = _interopRequireWildcard(require("./ContentTypeBadge"));
296
-
297
169
  var _TopicIntroductionList = _interopRequireDefault(require("./TopicIntroductionList"));
298
170
 
299
171
  var _TopicMenu = _interopRequireWildcard(require("./TopicMenu"));
300
172
 
301
173
  var _CompetenceGoals = _interopRequireWildcard(require("./CompetenceGoals"));
302
174
 
303
- var _MediaList = require("./MediaList");
304
-
305
175
  var _Embedded = require("./Embedded");
306
176
 
307
- var _Animation = require("./Animation");
308
-
309
- var _NDLAFilm = require("./NDLAFilm");
310
-
311
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
312
-
313
177
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
314
178
 
315
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
179
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
180
+
181
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
package/lib/index.d.ts CHANGED
@@ -64,6 +64,10 @@ export type { BreadcrumbItemProps } from './Breadcrumblist/Breadcrumblist';
64
64
  export { i18nInstance, formatNestedMessages, formatMessage } from './i18n';
65
65
  export { default as ResourceGroup } from './ResourceGroup';
66
66
  export { default as LayoutItem, OneColumn, PageContainer, Content } from './Layout';
67
+ export { FilmSlideshow, MovieGrid, AboutNdlaFilm, FilmMovieSearch, FilmMovieList, AllMoviesAlphabetically, } from './NDLAFilm';
68
+ export { DisplayOnPageYOffset } from './Animation';
69
+ export { MediaList, MediaListItem, MediaListItemBody, MediaListItemActions, MediaListItemImage, MediaListItemMeta, } from './MediaList';
70
+ export { default as ContentTypeBadge, SubjectMaterialBadge, TasksAndActivitiesBadge, AssessmentResourcesBadge, LearningPathBadge, SubjectBadge, ExternalLearningResourcesBadge, SourceMaterialBadge, } from './ContentTypeBadge';
67
71
  export { SubjectAbout, SubjectArchive, SubjectCarousel, SubjectChildContent, SubjectContent, SubjectFilter, SubjectFlexChild, SubjectFlexWrapper, SubjectHeader, SubjectLinks, SubjectNewContent, SubjectSecondaryContent, SubjectSectionTitle, SubjectShortcuts, SubjectSidebarWrapper, SubjectSocialContent, SubjectSocialSection, SubjectTopics, SubjectBanner, } from './Subject';
68
72
  export { default as ContentCard } from './ContentCard';
69
73
  export { default as CopyParagraphButton } from './CopyParagraphButton';
package/lib/index.js CHANGED
@@ -124,6 +124,27 @@ var _exportNames = {
124
124
  OneColumn: true,
125
125
  PageContainer: true,
126
126
  Content: true,
127
+ FilmSlideshow: true,
128
+ MovieGrid: true,
129
+ AboutNdlaFilm: true,
130
+ FilmMovieSearch: true,
131
+ FilmMovieList: true,
132
+ AllMoviesAlphabetically: true,
133
+ DisplayOnPageYOffset: true,
134
+ MediaList: true,
135
+ MediaListItem: true,
136
+ MediaListItemBody: true,
137
+ MediaListItemActions: true,
138
+ MediaListItemImage: true,
139
+ MediaListItemMeta: true,
140
+ ContentTypeBadge: true,
141
+ SubjectMaterialBadge: true,
142
+ TasksAndActivitiesBadge: true,
143
+ AssessmentResourcesBadge: true,
144
+ LearningPathBadge: true,
145
+ SubjectBadge: true,
146
+ ExternalLearningResourcesBadge: true,
147
+ SourceMaterialBadge: true,
127
148
  SubjectAbout: true,
128
149
  SubjectArchive: true,
129
150
  SubjectCarousel: true,
@@ -854,6 +875,132 @@ Object.defineProperty(exports, "Content", {
854
875
  return _Layout.Content;
855
876
  }
856
877
  });
878
+ Object.defineProperty(exports, "FilmSlideshow", {
879
+ enumerable: true,
880
+ get: function get() {
881
+ return _NDLAFilm.FilmSlideshow;
882
+ }
883
+ });
884
+ Object.defineProperty(exports, "MovieGrid", {
885
+ enumerable: true,
886
+ get: function get() {
887
+ return _NDLAFilm.MovieGrid;
888
+ }
889
+ });
890
+ Object.defineProperty(exports, "AboutNdlaFilm", {
891
+ enumerable: true,
892
+ get: function get() {
893
+ return _NDLAFilm.AboutNdlaFilm;
894
+ }
895
+ });
896
+ Object.defineProperty(exports, "FilmMovieSearch", {
897
+ enumerable: true,
898
+ get: function get() {
899
+ return _NDLAFilm.FilmMovieSearch;
900
+ }
901
+ });
902
+ Object.defineProperty(exports, "FilmMovieList", {
903
+ enumerable: true,
904
+ get: function get() {
905
+ return _NDLAFilm.FilmMovieList;
906
+ }
907
+ });
908
+ Object.defineProperty(exports, "AllMoviesAlphabetically", {
909
+ enumerable: true,
910
+ get: function get() {
911
+ return _NDLAFilm.AllMoviesAlphabetically;
912
+ }
913
+ });
914
+ Object.defineProperty(exports, "DisplayOnPageYOffset", {
915
+ enumerable: true,
916
+ get: function get() {
917
+ return _Animation.DisplayOnPageYOffset;
918
+ }
919
+ });
920
+ Object.defineProperty(exports, "MediaList", {
921
+ enumerable: true,
922
+ get: function get() {
923
+ return _MediaList.MediaList;
924
+ }
925
+ });
926
+ Object.defineProperty(exports, "MediaListItem", {
927
+ enumerable: true,
928
+ get: function get() {
929
+ return _MediaList.MediaListItem;
930
+ }
931
+ });
932
+ Object.defineProperty(exports, "MediaListItemBody", {
933
+ enumerable: true,
934
+ get: function get() {
935
+ return _MediaList.MediaListItemBody;
936
+ }
937
+ });
938
+ Object.defineProperty(exports, "MediaListItemActions", {
939
+ enumerable: true,
940
+ get: function get() {
941
+ return _MediaList.MediaListItemActions;
942
+ }
943
+ });
944
+ Object.defineProperty(exports, "MediaListItemImage", {
945
+ enumerable: true,
946
+ get: function get() {
947
+ return _MediaList.MediaListItemImage;
948
+ }
949
+ });
950
+ Object.defineProperty(exports, "MediaListItemMeta", {
951
+ enumerable: true,
952
+ get: function get() {
953
+ return _MediaList.MediaListItemMeta;
954
+ }
955
+ });
956
+ Object.defineProperty(exports, "ContentTypeBadge", {
957
+ enumerable: true,
958
+ get: function get() {
959
+ return _ContentTypeBadge["default"];
960
+ }
961
+ });
962
+ Object.defineProperty(exports, "SubjectMaterialBadge", {
963
+ enumerable: true,
964
+ get: function get() {
965
+ return _ContentTypeBadge.SubjectMaterialBadge;
966
+ }
967
+ });
968
+ Object.defineProperty(exports, "TasksAndActivitiesBadge", {
969
+ enumerable: true,
970
+ get: function get() {
971
+ return _ContentTypeBadge.TasksAndActivitiesBadge;
972
+ }
973
+ });
974
+ Object.defineProperty(exports, "AssessmentResourcesBadge", {
975
+ enumerable: true,
976
+ get: function get() {
977
+ return _ContentTypeBadge.AssessmentResourcesBadge;
978
+ }
979
+ });
980
+ Object.defineProperty(exports, "LearningPathBadge", {
981
+ enumerable: true,
982
+ get: function get() {
983
+ return _ContentTypeBadge.LearningPathBadge;
984
+ }
985
+ });
986
+ Object.defineProperty(exports, "SubjectBadge", {
987
+ enumerable: true,
988
+ get: function get() {
989
+ return _ContentTypeBadge.SubjectBadge;
990
+ }
991
+ });
992
+ Object.defineProperty(exports, "ExternalLearningResourcesBadge", {
993
+ enumerable: true,
994
+ get: function get() {
995
+ return _ContentTypeBadge.ExternalLearningResourcesBadge;
996
+ }
997
+ });
998
+ Object.defineProperty(exports, "SourceMaterialBadge", {
999
+ enumerable: true,
1000
+ get: function get() {
1001
+ return _ContentTypeBadge.SourceMaterialBadge;
1002
+ }
1003
+ });
857
1004
  Object.defineProperty(exports, "SubjectAbout", {
858
1005
  enumerable: true,
859
1006
  get: function get() {
@@ -1102,6 +1249,14 @@ var _ResourceGroup = _interopRequireDefault(require("./ResourceGroup"));
1102
1249
 
1103
1250
  var _Layout = _interopRequireWildcard(require("./Layout"));
1104
1251
 
1252
+ var _NDLAFilm = require("./NDLAFilm");
1253
+
1254
+ var _Animation = require("./Animation");
1255
+
1256
+ var _MediaList = require("./MediaList");
1257
+
1258
+ var _ContentTypeBadge = _interopRequireWildcard(require("./ContentTypeBadge"));
1259
+
1105
1260
  var _Subject = require("./Subject");
1106
1261
 
1107
1262
  var _ContentCard = _interopRequireDefault(require("./ContentCard"));
package/lib/shapes.js CHANGED
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.CompetenceGoalShape = exports.ContentTypeResultShape = exports.ContentTypeShape = exports.ShortcutShape = exports.ResourceShape = exports.ArticleShape = exports.ContributorShape = exports.FootNoteShape = exports.TopicShape = exports.SubjectShape = exports.LicenseShape = exports.LicenseRightShape = void 0;
8
+ exports.CompetenceGoalShape = exports.ContentTypeResultShape = exports.ContentTypeShape = exports.ResourceShape = exports.ArticleShape = exports.ContributorShape = exports.FootNoteShape = exports.TopicShape = exports.SubjectShape = exports.LicenseShape = exports.LicenseRightShape = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -100,15 +100,6 @@ var ResourceShape = _propTypes["default"].shape({
100
100
 
101
101
  exports.ResourceShape = ResourceShape;
102
102
 
103
- var ShortcutShape = _propTypes["default"].shape({
104
- tooltip: _propTypes["default"].string.isRequired,
105
- contentType: _propTypes["default"].string.isRequired,
106
- url: _propTypes["default"].string.isRequired,
107
- count: _propTypes["default"].number.isRequired
108
- });
109
-
110
- exports.ShortcutShape = ShortcutShape;
111
-
112
103
  var ContentTypeShape = _propTypes["default"].oneOf([contentTypes.SUBJECT_MATERIAL, contentTypes.TASKS_AND_ACTIVITIES, contentTypes.ASSESSMENT_RESOURCES, contentTypes.SUBJECT, contentTypes.EXTERNAL_LEARNING_RESOURCES, contentTypes.SOURCE_MATERIAL, contentTypes.LEARNING_PATH, contentTypes.TOPIC, 'beta', 'ndla-film', 'ndla-film has-image']);
113
104
 
114
105
  exports.ContentTypeShape = ContentTypeShape;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "3.3.13",
3
+ "version": "3.3.14",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,17 +31,17 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
- "@ndla/button": "^1.1.4",
35
- "@ndla/carousel": "^1.1.2",
36
- "@ndla/core": "^0.7.2",
34
+ "@ndla/button": "^1.1.5",
35
+ "@ndla/carousel": "^1.1.3",
36
+ "@ndla/core": "^0.7.3",
37
37
  "@ndla/hooks": "^1.0.7",
38
38
  "@ndla/icons": "^1.4.1",
39
- "@ndla/licenses": "^1.1.6",
40
- "@ndla/modal": "^1.1.18",
39
+ "@ndla/licenses": "^1.1.7",
40
+ "@ndla/modal": "^1.1.19",
41
41
  "@ndla/safelink": "^1.0.9",
42
- "@ndla/switch": "^0.0.32",
43
- "@ndla/tabs": "^1.0.15",
44
- "@ndla/tooltip": "^0.2.49",
42
+ "@ndla/switch": "^0.0.33",
43
+ "@ndla/tabs": "^1.0.16",
44
+ "@ndla/tooltip": "^0.2.50",
45
45
  "@ndla/util": "^2.0.1",
46
46
  "@reach/menu-button": "^0.12.1",
47
47
  "@reach/slider": "^0.12.1",
@@ -92,5 +92,5 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "gitHead": "15388cbdbe3dae57fef57a86f58380437b8264fc"
95
+ "gitHead": "fbf8c794dcdc3e753ae4c19f4805f1387f3bcfc3"
96
96
  }
@@ -121,8 +121,9 @@ interface FigureCaptionProps {
121
121
 
122
122
  const Figure = ({ children, type = 'full', resizeIframe, ...rest }: Props) => {
123
123
  const typeClass = type === 'full-column' ? 'c-figure--full-column' : `u-float-${type}`;
124
+ const right = ['small-right', 'xsmall-right'].includes(type);
124
125
  return (
125
- <figure data-sizetype={type} {...classes('', { resize: !!resizeIframe }, typeClass)} {...rest}>
126
+ <figure data-sizetype={type} {...classes('', { resize: !!resizeIframe, right }, typeClass)} {...rest}>
126
127
  {isFunction(children) ? children({ typeClass }) : children}
127
128
  </figure>
128
129
  );
@@ -17,6 +17,25 @@
17
17
  **/
18
18
 
19
19
  /* 1. */
20
+
21
+ @keyframes rightFloatTransition {
22
+ 0% {
23
+ left: 75%;
24
+ }
25
+ 100% {
26
+ left: -16.6%;
27
+ }
28
+ }
29
+
30
+ @keyframes smallRightFloatTransition {
31
+ 0% {
32
+ left: 78.5%;
33
+ }
34
+ 100% {
35
+ left: -16.6%;
36
+ }
37
+ }
38
+
20
39
  .c-figure {
21
40
  img {
22
41
  width: 100%;
@@ -51,6 +70,21 @@
51
70
  padding-bottom: $spacing--large;
52
71
  margin-bottom: 0;
53
72
  }
73
+ &--right {
74
+ &.expanded {
75
+ @include mq($from: desktop) {
76
+ animation-name: rightFloatTransition;
77
+ animation-duration: 0.4s;
78
+ }
79
+
80
+ &[data-sizetype='xsmall-right'] {
81
+ @include mq($from: desktop) {
82
+ animation-name: smallRightFloatTransition;
83
+ animation-duration: 0.4s;
84
+ }
85
+ }
86
+ }
87
+ }
54
88
  &.expanded {
55
89
  .c-figure__caption--hidden-caption {
56
90
  display: block;
@@ -74,7 +108,7 @@
74
108
  background-color: $white;
75
109
  padding: $spacing--small 0;
76
110
  display: block;
77
- border-bottom: 1px solid #D1D6DB;
111
+ border-bottom: 1px solid #d1d6db;
78
112
  }
79
113
 
80
114
  .c-figure__caption--hidden-caption {
@@ -119,7 +153,7 @@
119
153
  margin-bottom: $spacing--small;
120
154
  }
121
155
  p {
122
- margin:0;
156
+ margin: 0;
123
157
  }
124
158
  }
125
159
 
@@ -179,7 +213,7 @@
179
213
  padding: $spacing--small;
180
214
  transition: all 0.3s ease-out;
181
215
  background: rgba($white, 0.2);
182
- border:0;
216
+ border: 0;
183
217
 
184
218
  .expanded-icon {
185
219
  display: none;
@@ -1,11 +1,11 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { OneColumn } from '@ndla/ui';
1
+ import React, { ReactNode } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import styled from '@emotion/styled';
4
4
  import Modal, { ModalHeader, ModalBody, ModalCloseButton } from '@ndla/modal';
5
5
  import { colors, spacing, fonts, mq, breakpoints } from '@ndla/core';
6
+ //@ts-ignore
6
7
  import Button from '@ndla/button';
7
- import styled from '@emotion/styled';
8
- import { useTranslation } from 'react-i18next';
8
+ import { OneColumn } from '..';
9
9
  import VisualElement from './VisualElement';
10
10
 
11
11
  const StyledAside = styled.aside`
@@ -44,7 +44,20 @@ const StyledAside = styled.aside`
44
44
  }
45
45
  `;
46
46
 
47
- const AboutNdlaFilm = ({ aboutNDLAVideo, moreAboutNdlaFilm }) => {
47
+ interface Props {
48
+ aboutNDLAVideo: {
49
+ title: string;
50
+ description: string;
51
+ visualElement: {
52
+ alt?: string;
53
+ url: string;
54
+ type: string;
55
+ };
56
+ };
57
+ moreAboutNdlaFilm: ReactNode;
58
+ }
59
+
60
+ const AboutNdlaFilm = ({ aboutNDLAVideo, moreAboutNdlaFilm }: Props) => {
48
61
  const { t } = useTranslation();
49
62
  return (
50
63
  <div className="o-wrapper">
@@ -71,16 +84,4 @@ const AboutNdlaFilm = ({ aboutNDLAVideo, moreAboutNdlaFilm }) => {
71
84
  );
72
85
  };
73
86
 
74
- AboutNdlaFilm.propTypes = {
75
- aboutNDLAVideo: PropTypes.shape({
76
- title: PropTypes.string,
77
- description: PropTypes.string,
78
- visualElement: PropTypes.shape({
79
- url: PropTypes.string,
80
- alt: PropTypes.string,
81
- type: PropTypes.string,
82
- }),
83
- }),
84
- };
85
-
86
87
  export default AboutNdlaFilm;
@@ -15,7 +15,7 @@ import { breakpoints, mq, spacing, spacingUnit, colors, fonts, animations } from
15
15
  import SafeLink from '@ndla/safelink';
16
16
  // @ts-ignore
17
17
  import { makeSrcQueryString } from '../Image';
18
- import { movieType } from './types';
18
+ import { MovieType } from './types';
19
19
  import { isLetter } from './isLetter';
20
20
  const IMAGE_WIDTH = 143;
21
21
 
@@ -158,7 +158,7 @@ const StyledSafeLink = styled(SafeLink)<isIEProps>`
158
158
  `;
159
159
 
160
160
  interface Props {
161
- movies: movieType[];
161
+ movies: MovieType[];
162
162
  locale: string;
163
163
  }
164
164
 
@@ -231,7 +231,7 @@ const AllMoviesAlphabetically: React.FunctionComponent<Props> = ({ movies, local
231
231
 
232
232
  return (
233
233
  <StyledWrapper ref={wrapperRef}>
234
- {movies.map((movie: movieType, index: number) => {
234
+ {movies.map((movie: MovieType, index: number) => {
235
235
  const currentLetter = movie.title.substr(0, 1);
236
236
  const isNewLetter = currentLetter.localeCompare(previousLetter, locale) === 1 && isLetter(movie.title);
237
237
  previousLetter = currentLetter;
@@ -1,28 +1,40 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
1
+ import React, { Component } from 'react';
3
2
  import BEMHelper from 'react-bem-helper';
4
3
  import FocusTrapReact from 'focus-trap-react';
5
4
  import { ChevronDown } from '@ndla/icons/common';
6
- import { withTranslation } from 'react-i18next';
5
+ import { WithTranslation, withTranslation } from 'react-i18next';
6
+ import { MovieResourceType } from './types';
7
7
 
8
8
  const classes = new BEMHelper({
9
9
  name: 'film-moviesearch',
10
10
  prefix: 'c-',
11
11
  });
12
12
 
13
- class CategorySelect extends React.Component {
14
- constructor(props) {
13
+ interface Props extends WithTranslation {
14
+ resourceTypes: MovieResourceType[];
15
+ resourceTypeSelected?: MovieResourceType;
16
+ ariaControlId?: string;
17
+ onChangeResourceType: (resourceId?: string) => void;
18
+ }
19
+
20
+ interface State {
21
+ resourceTypesIsOpen: boolean;
22
+ }
23
+ class CategorySelect extends Component<Props, State> {
24
+ references: Record<string, HTMLButtonElement | null>;
25
+ constructor(props: Props) {
15
26
  super(props);
16
27
  this.state = {
17
28
  resourceTypesIsOpen: false,
18
29
  };
30
+ this.references = {};
19
31
  this.createRef = this.createRef.bind(this);
20
32
  this.openSelect = this.openSelect.bind(this);
21
33
  this.onSelect = this.onSelect.bind(this);
22
34
  }
23
35
 
24
- createRef(el, name) {
25
- this[name] = el;
36
+ createRef(el: HTMLButtonElement | null, name: string) {
37
+ this.references[name] = el;
26
38
  }
27
39
 
28
40
  openSelect() {
@@ -32,14 +44,14 @@ class CategorySelect extends React.Component {
32
44
  resourceTypesIsOpen: true,
33
45
  },
34
46
  () => {
35
- if (resourceTypeSelected && this[resourceTypeSelected.id]) {
36
- this[resourceTypeSelected.id].focus();
47
+ if (resourceTypeSelected && this.references[resourceTypeSelected.id]) {
48
+ this.references[resourceTypeSelected.id]?.focus();
37
49
  }
38
50
  },
39
51
  );
40
52
  }
41
53
 
42
- onSelect(val) {
54
+ onSelect(val?: string) {
43
55
  this.props.onChangeResourceType(val);
44
56
  this.setState({
45
57
  resourceTypesIsOpen: false,
@@ -97,7 +109,7 @@ class CategorySelect extends React.Component {
97
109
  ref={(el) => this.createRef(el, resourceType.id)}
98
110
  onClick={() => this.onSelect(resourceType.id)}
99
111
  {...classes('dropdown-button', {
100
- selected: resourceTypeSelected && resourceTypeSelected.id === resourceType.id,
112
+ selected: !!resourceTypeSelected && resourceTypeSelected.id === resourceType.id,
101
113
  })}
102
114
  data-id={resourceType.id}
103
115
  key={resourceType.id}>
@@ -112,13 +124,4 @@ class CategorySelect extends React.Component {
112
124
  }
113
125
  }
114
126
 
115
- CategorySelect.propTypes = {
116
- resourceTypes: PropTypes.arrayOf(PropTypes.object),
117
- resourceTypeSelected: PropTypes.shape({
118
- id: PropTypes.string,
119
- name: PropTypes.string,
120
- }),
121
- ariaControlId: PropTypes.string,
122
- };
123
-
124
127
  export default withTranslation()(CategorySelect);