@ndla/ui 13.2.0 → 14.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 (91) hide show
  1. package/es/Footer/FooterAuth.js +15 -22
  2. package/es/LearningPaths/LearningPathMenu.js +3 -4
  3. package/es/Masthead/MastheadAuthModal.js +2 -2
  4. package/es/Notion/ConceptNotion.js +2 -1
  5. package/es/Notion/FigureNotion.js +14 -10
  6. package/es/Notion/NotionVisualElement.js +3 -2
  7. package/es/ResourceGroup/ResourceItem.js +14 -17
  8. package/es/Search/ActiveFilters.js +6 -7
  9. package/es/Search/ContentTypeResult.js +6 -8
  10. package/es/SearchTypeResult/ActiveFilters.js +6 -10
  11. package/es/SearchTypeResult/SearchViewType.js +5 -5
  12. package/es/TopicIntroductionList/TopicIntroduction.js +2 -4
  13. package/es/TopicIntroductionList/TopicShortcutItem.js +1 -3
  14. package/es/User/AuthModal.js +15 -24
  15. package/es/User/UserInfo.js +70 -0
  16. package/es/User/apiTypes.js +0 -0
  17. package/es/User/index.js +2 -0
  18. package/es/User/parseUserObject.js +102 -0
  19. package/es/all.css +18 -0
  20. package/es/index.js +1 -0
  21. package/es/locale/messages-en.js +13 -4
  22. package/es/locale/messages-nb.js +13 -4
  23. package/es/locale/messages-nn.js +13 -4
  24. package/es/locale/messages-se.js +13 -4
  25. package/es/locale/messages-sma.js +13 -4
  26. package/lib/Footer/FooterAuth.d.ts +1 -1
  27. package/lib/Footer/FooterAuth.js +17 -17
  28. package/lib/LearningPaths/LearningPathMenu.js +3 -4
  29. package/lib/Masthead/MastheadAuthModal.d.ts +3 -3
  30. package/lib/Masthead/MastheadAuthModal.js +3 -3
  31. package/lib/Notion/ConceptNotion.js +2 -1
  32. package/lib/Notion/FigureNotion.d.ts +1 -1
  33. package/lib/Notion/FigureNotion.js +13 -9
  34. package/lib/Notion/NotionVisualElement.js +3 -2
  35. package/lib/ResourceGroup/ResourceItem.js +14 -17
  36. package/lib/Search/ActiveFilters.js +6 -7
  37. package/lib/Search/ContentTypeResult.js +6 -8
  38. package/lib/SearchTypeResult/ActiveFilters.js +6 -10
  39. package/lib/SearchTypeResult/SearchViewType.js +5 -5
  40. package/lib/TopicIntroductionList/TopicIntroduction.js +2 -4
  41. package/lib/TopicIntroductionList/TopicShortcutItem.js +1 -3
  42. package/lib/User/AuthModal.d.ts +3 -3
  43. package/lib/User/AuthModal.js +16 -23
  44. package/lib/User/UserInfo.d.ts +13 -0
  45. package/lib/User/UserInfo.js +84 -0
  46. package/lib/User/apiTypes.d.ts +61 -0
  47. package/lib/User/apiTypes.js +1 -0
  48. package/lib/User/index.d.ts +4 -0
  49. package/lib/User/index.js +8 -0
  50. package/lib/User/parseUserObject.d.ts +32 -0
  51. package/lib/User/parseUserObject.js +105 -0
  52. package/lib/all.css +18 -0
  53. package/lib/index.d.ts +2 -0
  54. package/lib/index.js +8 -1
  55. package/lib/locale/messages-en.d.ts +9 -0
  56. package/lib/locale/messages-en.js +13 -4
  57. package/lib/locale/messages-nb.d.ts +9 -0
  58. package/lib/locale/messages-nb.js +13 -4
  59. package/lib/locale/messages-nn.d.ts +9 -0
  60. package/lib/locale/messages-nn.js +13 -4
  61. package/lib/locale/messages-se.d.ts +9 -0
  62. package/lib/locale/messages-se.js +13 -4
  63. package/lib/locale/messages-sma.d.ts +9 -0
  64. package/lib/locale/messages-sma.js +13 -4
  65. package/package.json +5 -5
  66. package/src/Footer/FooterAuth.tsx +7 -9
  67. package/src/LearningPaths/LearningPathMenu.tsx +1 -1
  68. package/src/Masthead/MastheadAuthModal.tsx +4 -5
  69. package/src/Notion/ConceptNotion.tsx +1 -0
  70. package/src/Notion/FigureNotion.tsx +13 -6
  71. package/src/Notion/NotionVisualElement.tsx +1 -1
  72. package/src/ResourceGroup/ResourceItem.tsx +3 -3
  73. package/src/Search/ActiveFilters.jsx +0 -1
  74. package/src/Search/ContentTypeResult.tsx +8 -9
  75. package/src/SearchTypeResult/ActiveFilters.tsx +1 -3
  76. package/src/SearchTypeResult/SearchViewType.tsx +1 -1
  77. package/src/TopicIntroductionList/TopicIntroduction.tsx +2 -2
  78. package/src/TopicIntroductionList/TopicShortcutItem.tsx +1 -5
  79. package/src/User/AuthModal.tsx +5 -26
  80. package/src/User/UserInfo.tsx +80 -0
  81. package/src/User/__tests__/parseUserObject-test.ts +315 -0
  82. package/src/User/apiTypes.ts +74 -0
  83. package/src/User/index.ts +4 -0
  84. package/src/User/parseUserObject.ts +83 -0
  85. package/src/all.scss +1 -0
  86. package/src/index.ts +2 -0
  87. package/src/locale/messages-en.ts +13 -4
  88. package/src/locale/messages-nb.ts +13 -4
  89. package/src/locale/messages-nn.ts +13 -4
  90. package/src/locale/messages-se.ts +13 -4
  91. package/src/locale/messages-sma.ts +13 -4
package/lib/index.d.ts CHANGED
@@ -37,7 +37,9 @@ export { default as ContentTypeResult } from './Search/ContentTypeResult';
37
37
  export { SearchFieldForm } from './Search/SearchFieldForm';
38
38
  export { default as MastheadSearchModal } from './Masthead/MastheadSearchModal';
39
39
  export { default as MastheadAuthModal } from './Masthead/MastheadAuthModal';
40
+ export { UserInfo } from './User';
40
41
  export { default as AuthModal } from './User';
42
+ export type { FeideGoGroup, FeideGroup, FeideOrg, FeideUserApiType } from './User';
41
43
  export { default as CreatedBy } from './CreatedBy';
42
44
  export { default as Breadcrumblist } from './Breadcrumblist';
43
45
  export { MessageBox, MessageBoxTag, MessageBoxType } from './MessageBox';
package/lib/index.js CHANGED
@@ -87,6 +87,7 @@ var _exportNames = {
87
87
  SearchFieldForm: true,
88
88
  MastheadSearchModal: true,
89
89
  MastheadAuthModal: true,
90
+ UserInfo: true,
90
91
  AuthModal: true,
91
92
  CreatedBy: true,
92
93
  Breadcrumblist: true,
@@ -665,6 +666,12 @@ Object.defineProperty(exports, "MastheadAuthModal", {
665
666
  return _MastheadAuthModal["default"];
666
667
  }
667
668
  });
669
+ Object.defineProperty(exports, "UserInfo", {
670
+ enumerable: true,
671
+ get: function get() {
672
+ return _User.UserInfo;
673
+ }
674
+ });
668
675
  Object.defineProperty(exports, "AuthModal", {
669
676
  enumerable: true,
670
677
  get: function get() {
@@ -1285,7 +1292,7 @@ var _MastheadSearchModal = _interopRequireDefault(require("./Masthead/MastheadSe
1285
1292
 
1286
1293
  var _MastheadAuthModal = _interopRequireDefault(require("./Masthead/MastheadAuthModal"));
1287
1294
 
1288
- var _User = _interopRequireDefault(require("./User"));
1295
+ var _User = _interopRequireWildcard(require("./User"));
1289
1296
 
1290
1297
  var _CreatedBy = _interopRequireDefault(require("./CreatedBy"));
1291
1298
 
@@ -33,6 +33,15 @@ declare const messages: {
33
33
  resource: {
34
34
  accessDenied: string;
35
35
  };
36
+ primarySchool: string;
37
+ name: string;
38
+ mail: string;
39
+ username: string;
40
+ groupTypes: {
41
+ basic: string;
42
+ teaching: string;
43
+ other: string;
44
+ };
36
45
  };
37
46
  checkOutNewFeature: string;
38
47
  slateBlockMenu: {
@@ -719,15 +719,15 @@ var messages = _objectSpread(_objectSpread({
719
719
  },
720
720
  blogPosts: {
721
721
  blog1: {
722
- text: 'Nye fag NDLA',
723
- externalLink: 'https://blogg.ndla.no/2021/12/nye-fag-pa-ndla/',
722
+ text: 'Forslag til årsplaner fra NDLA',
723
+ externalLink: 'https://blogg.ndla.no/2021/08/forslag-til-arsplaner-hos-ndla/',
724
724
  linkText: 'Fagblogg',
725
725
  license: 'CC-BY-SA-4.0',
726
726
  licenseAuthor: 'Vibeke Klungland'
727
727
  },
728
728
  blog2: {
729
- text: 'Aktiviser elevane med digitale verktøy',
730
- externalLink: 'https://blogg.ndla.no/2021/09/aktiviser-elevane-med-digitale-verktoy/',
729
+ text: 'Huskeliste for kontaktlærere',
730
+ externalLink: 'https://blogg.ndla.no/2019/08/huskeliste-for-kontaktlaerere/',
731
731
  linkText: 'Fagblogg',
732
732
  license: 'CC-BY-SA-4.0',
733
733
  licenseAuthor: 'Tom Knudsen'
@@ -906,6 +906,15 @@ var messages = _objectSpread(_objectSpread({
906
906
  },
907
907
  resource: {
908
908
  accessDenied: 'We are sorry, but this resource is only available to teachers who are logged in with Feide.'
909
+ },
910
+ primarySchool: 'Primary School',
911
+ name: 'Name',
912
+ mail: 'E-mail',
913
+ username: 'Username',
914
+ groupTypes: {
915
+ basic: 'Basic group',
916
+ teaching: 'Teaching group',
917
+ other: 'Other groups'
909
918
  }
910
919
  },
911
920
  checkOutNewFeature: 'New feature',
@@ -33,6 +33,15 @@ declare const messages: {
33
33
  resource: {
34
34
  accessDenied: string;
35
35
  };
36
+ primarySchool: string;
37
+ name: string;
38
+ mail: string;
39
+ username: string;
40
+ groupTypes: {
41
+ basic: string;
42
+ teaching: string;
43
+ other: string;
44
+ };
36
45
  };
37
46
  checkOutNewFeature: string;
38
47
  slateBlockMenu: {
@@ -719,15 +719,15 @@ var messages = _objectSpread(_objectSpread({
719
719
  },
720
720
  blogPosts: {
721
721
  blog1: {
722
- text: 'Nye fag NDLA',
723
- externalLink: 'https://blogg.ndla.no/2021/12/nye-fag-pa-ndla/',
722
+ text: 'Forslag til årsplaner fra NDLA',
723
+ externalLink: 'https://blogg.ndla.no/2021/08/forslag-til-arsplaner-hos-ndla/',
724
724
  linkText: 'Fagblogg',
725
725
  license: 'CC-BY-SA-4.0',
726
726
  licenseAuthor: 'Vibeke Klungland'
727
727
  },
728
728
  blog2: {
729
- text: 'Aktiviser elevene med digitale verktøy',
730
- externalLink: 'https://blogg.ndla.no/2021/09/aktiviser-elevane-med-digitale-verktoy/',
729
+ text: 'Huskeliste for kontaktlærere',
730
+ externalLink: 'https://blogg.ndla.no/2019/08/huskeliste-for-kontaktlaerere/',
731
731
  linkText: 'Fagblogg',
732
732
  license: 'CC-BY-SA-4.0',
733
733
  licenseAuthor: 'Tom Knudsen'
@@ -906,6 +906,15 @@ var messages = _objectSpread(_objectSpread({
906
906
  },
907
907
  resource: {
908
908
  accessDenied: 'Vi beklager, men denne ressursen er bare for lærere innlogget med Feide.'
909
+ },
910
+ primarySchool: 'Hovedskole',
911
+ name: 'Navn',
912
+ mail: 'E-post',
913
+ username: 'Brukernavn',
914
+ groupTypes: {
915
+ basic: 'Basisgruppe',
916
+ teaching: 'Undervisningsgruppe',
917
+ other: 'Andre grupper'
909
918
  }
910
919
  },
911
920
  checkOutNewFeature: 'Sjekk ut ny funksjonalitet',
@@ -33,6 +33,15 @@ declare const messages: {
33
33
  resource: {
34
34
  accessDenied: string;
35
35
  };
36
+ primarySchool: string;
37
+ name: string;
38
+ mail: string;
39
+ username: string;
40
+ groupTypes: {
41
+ basic: string;
42
+ teaching: string;
43
+ other: string;
44
+ };
36
45
  };
37
46
  checkOutNewFeature: string;
38
47
  slateBlockMenu: {
@@ -719,15 +719,15 @@ var messages = _objectSpread(_objectSpread({
719
719
  },
720
720
  blogPosts: {
721
721
  blog1: {
722
- text: 'Nye fag NDLA',
723
- externalLink: 'https://blogg.ndla.no/2021/12/nye-fag-pa-ndla/',
722
+ text: 'Forslag til årsplaner fra NDLA',
723
+ externalLink: 'https://blogg.ndla.no/2021/08/forslag-til-arsplaner-hos-ndla/',
724
724
  linkText: 'Fagblogg',
725
725
  license: 'CC-BY-SA-4.0',
726
726
  licenseAuthor: 'Vibeke Klungland'
727
727
  },
728
728
  blog2: {
729
- text: 'Aktiviser elevane med digitale verktøy',
730
- externalLink: 'https://blogg.ndla.no/2021/09/aktiviser-elevane-med-digitale-verktoy/',
729
+ text: 'Huskeliste for kontaktlærere',
730
+ externalLink: 'https://blogg.ndla.no/2019/08/huskeliste-for-kontaktlaerere/',
731
731
  linkText: 'Fagblogg',
732
732
  license: 'CC-BY-SA-4.0',
733
733
  licenseAuthor: 'Tom Knudsen'
@@ -906,6 +906,15 @@ var messages = _objectSpread(_objectSpread({
906
906
  },
907
907
  resource: {
908
908
  accessDenied: 'Vi beklagar, men denne ressursen er berre for lærarar innlogga med Feide.'
909
+ },
910
+ primarySchool: 'Hovudskule',
911
+ name: 'Namn',
912
+ mail: 'E-post',
913
+ username: 'Brukarnamn',
914
+ groupTypes: {
915
+ basic: 'Basisgruppe',
916
+ teaching: 'Undervisningsgruppe',
917
+ other: 'Andre grupper'
909
918
  }
910
919
  },
911
920
  checkOutNewFeature: 'Sjekk ut ny funksjonalitet',
@@ -33,6 +33,15 @@ declare const messages: {
33
33
  resource: {
34
34
  accessDenied: string;
35
35
  };
36
+ primarySchool: string;
37
+ name: string;
38
+ mail: string;
39
+ username: string;
40
+ groupTypes: {
41
+ basic: string;
42
+ teaching: string;
43
+ other: string;
44
+ };
36
45
  };
37
46
  checkOutNewFeature: string;
38
47
  slateBlockMenu: {
@@ -719,15 +719,15 @@ var messages = _objectSpread(_objectSpread({
719
719
  },
720
720
  blogPosts: {
721
721
  blog1: {
722
- text: 'Nye fag NDLA',
723
- externalLink: 'https://blogg.ndla.no/2021/12/nye-fag-pa-ndla/',
722
+ text: 'Forslag til årsplaner fra NDLA',
723
+ externalLink: 'https://blogg.ndla.no/2021/08/forslag-til-arsplaner-hos-ndla/',
724
724
  linkText: 'Fagblogg',
725
725
  license: 'CC-BY-SA-4.0',
726
726
  licenseAuthor: 'Vibeke Klungland'
727
727
  },
728
728
  blog2: {
729
- text: 'Aktiviser elevene med digitale verktøy',
730
- externalLink: 'https://blogg.ndla.no/2021/09/aktiviser-elevane-med-digitale-verktoy/',
729
+ text: 'Huskeliste for kontaktlærere',
730
+ externalLink: 'https://blogg.ndla.no/2019/08/huskeliste-for-kontaktlaerere/',
731
731
  linkText: 'Fagblogg',
732
732
  license: 'CC-BY-SA-4.0',
733
733
  licenseAuthor: 'Tom Knudsen'
@@ -906,6 +906,15 @@ var messages = _objectSpread(_objectSpread({
906
906
  },
907
907
  resource: {
908
908
  accessDenied: 'Vi beklager, men denne ressursen er bare for lærere innlogget med Feide.'
909
+ },
910
+ primarySchool: 'Hovudskule',
911
+ name: 'Namn',
912
+ mail: 'E-post',
913
+ username: 'Brukarnamn',
914
+ groupTypes: {
915
+ basic: 'Basisgruppe',
916
+ teaching: 'Undervisningsgruppe',
917
+ other: 'Andre grupper'
909
918
  }
910
919
  },
911
920
  checkOutNewFeature: 'Sjekk ut ny funksjonalitet',
@@ -33,6 +33,15 @@ declare const messages: {
33
33
  resource: {
34
34
  accessDenied: string;
35
35
  };
36
+ primarySchool: string;
37
+ name: string;
38
+ mail: string;
39
+ username: string;
40
+ groupTypes: {
41
+ basic: string;
42
+ teaching: string;
43
+ other: string;
44
+ };
36
45
  };
37
46
  checkOutNewFeature: string;
38
47
  slateBlockMenu: {
@@ -719,15 +719,15 @@ var messages = _objectSpread(_objectSpread({
719
719
  },
720
720
  blogPosts: {
721
721
  blog1: {
722
- text: 'Nye fag NDLA',
723
- externalLink: 'https://blogg.ndla.no/2021/12/nye-fag-pa-ndla/',
722
+ text: 'Forslag til årsplaner fra NDLA',
723
+ externalLink: 'https://blogg.ndla.no/2021/08/forslag-til-arsplaner-hos-ndla/',
724
724
  linkText: 'Fagblogg',
725
725
  license: 'CC-BY-SA-4.0',
726
726
  licenseAuthor: 'Vibeke Klungland'
727
727
  },
728
728
  blog2: {
729
- text: 'Aktiviser elevene med digitale verktøy',
730
- externalLink: 'https://blogg.ndla.no/2021/09/aktiviser-elevane-med-digitale-verktoy/',
729
+ text: 'Huskeliste for kontaktlærere',
730
+ externalLink: 'https://blogg.ndla.no/2019/08/huskeliste-for-kontaktlaerere/',
731
731
  linkText: 'Fagblogg',
732
732
  license: 'CC-BY-SA-4.0',
733
733
  licenseAuthor: 'Tom Knudsen'
@@ -906,6 +906,15 @@ var messages = _objectSpread(_objectSpread({
906
906
  },
907
907
  resource: {
908
908
  accessDenied: 'Vi beklager, men denne ressursen er bare for lærere innlogget med Feide.'
909
+ },
910
+ primarySchool: 'Hovudskule',
911
+ name: 'Namn',
912
+ mail: 'E-post',
913
+ username: 'Brukarnamn',
914
+ groupTypes: {
915
+ basic: 'Basisgruppe',
916
+ teaching: 'Undervisningsgruppe',
917
+ other: 'Andre grupper'
909
918
  }
910
919
  },
911
920
  checkOutNewFeature: 'Sjekk ut ny funksjonalitet',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "13.2.0",
3
+ "version": "14.0.0",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -36,13 +36,13 @@
36
36
  "@ndla/core": "^2.1.1",
37
37
  "@ndla/hooks": "^1.1.4",
38
38
  "@ndla/icons": "^1.7.1",
39
- "@ndla/licenses": "^4.1.2",
39
+ "@ndla/licenses": "^4.1.3",
40
40
  "@ndla/modal": "^1.2.8",
41
- "@ndla/notion": "^3.1.9",
41
+ "@ndla/notion": "^3.1.10",
42
42
  "@ndla/safelink": "^2.0.2",
43
43
  "@ndla/switch": "^0.1.5",
44
44
  "@ndla/tabs": "^1.1.6",
45
- "@ndla/tooltip": "^0.3.5",
45
+ "@ndla/tooltip": "^1.0.0",
46
46
  "@ndla/util": "^3.0.0",
47
47
  "@reach/menu-button": "^0.16.2",
48
48
  "@reach/slider": "^0.16.0",
@@ -81,5 +81,5 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "gitHead": "35d7818447ec2144b5961dfad4269de46ed260db"
84
+ "gitHead": "79850025a1ab61d341fc5a507bed6fde7d7f4f84"
85
85
  }
@@ -6,15 +6,13 @@
6
6
  *
7
7
  */
8
8
 
9
- import React from 'react';
10
- import { useTranslation } from 'react-i18next';
11
9
  import styled from '@emotion/styled';
10
+ import Button from '@ndla/button';
12
11
  import { animations, colors, fonts, spacing } from '@ndla/core';
13
12
  import { ChevronDown, FeideText, LogIn, LogOut } from '@ndla/icons/common';
14
- import Button from '@ndla/button';
15
-
16
- import { AuthModalProps } from '../User/AuthModal';
17
- import AuthModal from '../User';
13
+ import React from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import AuthModal, { AuthModalProps } from '../User/AuthModal';
18
16
 
19
17
  const Wrapper = styled.div`
20
18
  display: flex;
@@ -66,7 +64,7 @@ const AuthedButton = styled(Button)`
66
64
  }
67
65
  `;
68
66
 
69
- const FooterAuth = ({ isAuthenticated, onAuthenticateClick, authorizedRole, ...rest }: AuthModalProps) => {
67
+ const FooterAuth = ({ isAuthenticated, user, onAuthenticateClick, ...rest }: AuthModalProps) => {
70
68
  const { t } = useTranslation();
71
69
  return (
72
70
  <Wrapper>
@@ -78,11 +76,11 @@ const FooterAuth = ({ isAuthenticated, onAuthenticateClick, authorizedRole, ...r
78
76
  <AuthModal
79
77
  {...rest}
80
78
  isAuthenticated={isAuthenticated}
79
+ user={user}
81
80
  onAuthenticateClick={onAuthenticateClick}
82
- authorizedRole={authorizedRole}
83
81
  activateButton={
84
82
  <AuthedButton ghostPill size="medium">
85
- {t('user.loggedInAsButton', { role: authorizedRole })}
83
+ {t('user.loggedInAsButton', { role: user?.eduPersonPrimaryAffiliation })}
86
84
  <ChevronDown />
87
85
  </AuthedButton>
88
86
  }
@@ -123,7 +123,7 @@ const LearningPathMenu = ({
123
123
  css={css`
124
124
  padding-left: ${spacing.small};
125
125
  `}>
126
- <Tooltip align="right" tooltip={t('learningPath.openMenuTooltip')}>
126
+ <Tooltip tooltip={t('learningPath.openMenuTooltip')}>
127
127
  <StyledToggleMenubutton type="button" onClick={() => toggleOpenState(!isOpen)}>
128
128
  {!isOpen ? <ArrowExpandRight /> : <ArrowExpandLeft />}
129
129
  </StyledToggleMenubutton>
@@ -11,8 +11,7 @@ import styled from '@emotion/styled';
11
11
  import Button from '@ndla/button';
12
12
  import { Feide } from '@ndla/icons/common';
13
13
 
14
- import AuthModal from '../User';
15
- import { AuthModalProps } from '../User/AuthModal';
14
+ import AuthModal, { AuthModalProps } from '../User/AuthModal';
16
15
 
17
16
  type FeideWrapperProps = {
18
17
  inverted?: boolean;
@@ -31,11 +30,11 @@ const StyledButton = styled(Button)<FeideWrapperProps>`
31
30
  }
32
31
  `;
33
32
 
34
- type Props = {
33
+ interface Props extends AuthModalProps {
35
34
  inverted?: boolean;
36
- };
35
+ }
37
36
 
38
- const MastheadAuthModal = ({ inverted, ...rest }: Props & AuthModalProps) => {
37
+ const MastheadAuthModal = ({ inverted, ...rest }: Props) => {
39
38
  return (
40
39
  <AuthModal
41
40
  {...rest}
@@ -74,6 +74,7 @@ const ConceptNotion = ({ concept, disableScripts, type, hideIconsAndAuthors, fig
74
74
  <FigureNotion
75
75
  resizeIframe
76
76
  id={figureId}
77
+ title={concept.title}
77
78
  figureId={visualElementId}
78
79
  copyright={concept.copyright}
79
80
  licenseString={concept.copyright?.license?.license ?? ''}
@@ -7,7 +7,7 @@
7
7
 
8
8
  import styled from '@emotion/styled';
9
9
  import { colors, spacing } from '@ndla/core';
10
- import { getLicenseByAbbreviation, getLicenseCredits } from '@ndla/licenses';
10
+ import { getGroupedContributorDescriptionList, getLicenseByAbbreviation, getLicenseCredits } from '@ndla/licenses';
11
11
  import React, { ReactNode } from 'react';
12
12
  import { useTranslation } from 'react-i18next';
13
13
  import { Figure, FigureCaption, FigureLicenseDialog, FigureType } from '../Figure';
@@ -23,7 +23,7 @@ interface Props {
23
23
  figureId: string;
24
24
  children: ReactNode | ((params: { typeClass: string }) => ReactNode);
25
25
  id: string;
26
- title?: string;
26
+ title: string;
27
27
  copyright?: Partial<Copyright>;
28
28
  licenseString: string;
29
29
  type: 'video' | 'h5p' | 'image' | 'concept' | 'other';
@@ -47,10 +47,16 @@ const FigureNotion = ({
47
47
  }: Props) => {
48
48
  const { t, i18n } = useTranslation();
49
49
  const license = getLicenseByAbbreviation(licenseString, i18n.language);
50
- const { creators, rightsholders, processors } = getLicenseCredits(copyright);
50
+ const licenseCredits = getLicenseCredits(copyright);
51
+ const { creators, rightsholders, processors } = licenseCredits;
51
52
 
52
53
  const authors = creators.length || rightsholders.length ? [...creators, ...rightsholders] : [...processors];
53
54
 
55
+ const groupedAuthors = getGroupedContributorDescriptionList(licenseCredits, i18n.language).map((item) => ({
56
+ name: item.description,
57
+ type: item.label,
58
+ }));
59
+
54
60
  return (
55
61
  <Figure resizeIframe={resizeIframe} id={figureId} type={figureType || 'full-column'}>
56
62
  {({ typeClass }) => (
@@ -67,18 +73,19 @@ const FigureNotion = ({
67
73
  hideIconsAndAuthors={hideIconsAndAuthors}>
68
74
  <FigureLicenseDialog
69
75
  id={id}
70
- authors={authors}
76
+ authors={groupedAuthors}
71
77
  locale={i18n.language}
72
78
  title={title}
73
79
  origin={copyright?.origin}
74
80
  license={license}
75
81
  messages={{
76
82
  close: t('close'),
77
- rulesForUse: t('license.concept.rules'),
83
+ rulesForUse: t(`license.${type}.rules`),
78
84
  source: t('source'),
79
85
  learnAboutLicenses: t('license.learnMore'),
80
86
  title: t('title'),
81
- }}></FigureLicenseDialog>
87
+ }}
88
+ />
82
89
  </FigureCaption>
83
90
  ) : (
84
91
  <BottomBorder />
@@ -68,7 +68,7 @@ const NotionVisualElement = ({ visualElement, id, figureId }: Props) => {
68
68
  {visualElement.image?.src ? (
69
69
  <img src={visualElement.image?.src} alt={visualElement.image.alt} />
70
70
  ) : (
71
- <StyledIframe type={type} src={visualElement.url} title={visualElement.title} />
71
+ <StyledIframe allowFullScreen type={type} src={visualElement.url} title={visualElement.title} />
72
72
  )}
73
73
  </FigureNotion>
74
74
  );
@@ -273,19 +273,19 @@ const ResourceItem = ({
273
273
  <TypeWrapper>
274
274
  {contentTypeName && <ContentTypeName>{contentTypeName}</ContentTypeName>}
275
275
  {access && access === 'teacher' && (
276
- <Tooltip tooltip={t('article.access.onlyTeacher')} align="left">
276
+ <Tooltip tooltip={t('article.access.onlyTeacher')}>
277
277
  <HumanMaleBoard className="c-icon--20 u-margin-left-tiny c-topic-resource__list__additional-icons" />
278
278
  </Tooltip>
279
279
  )}
280
280
  {showAdditionalResources && contentTypeDescription && (
281
281
  <>
282
282
  {additional && (
283
- <Tooltip tooltip={contentTypeDescription} align="left">
283
+ <Tooltip tooltip={contentTypeDescription}>
284
284
  <Additional className="c-icon--20 u-margin-left-tiny c-topic-resource__list__additional-icons" />
285
285
  </Tooltip>
286
286
  )}
287
287
  {!additional && (
288
- <Tooltip tooltip={contentTypeDescription} align="left">
288
+ <Tooltip tooltip={contentTypeDescription}>
289
289
  <Core className="c-icon--20 u-margin-left-tiny c-topic-resource__list__additional-icons" />
290
290
  </Tooltip>
291
291
  )}
@@ -85,7 +85,6 @@ const ActiveFilters = ({ filters, onFilterRemove, showOnSmallScreen }) => {
85
85
  <StyledActiveFilterWrapper key={filterKey}>
86
86
  {filterLength > 1 ? (
87
87
  <Tooltip
88
- align="top"
89
88
  tooltip={t('searchPage.searchFilterMessages.removeFilter', {
90
89
  filterName: filter.title,
91
90
  })}>
@@ -1,29 +1,28 @@
1
- import React, { useState, useEffect, useRef, ReactElement } from 'react';
2
1
  import Button from '@ndla/button';
3
- import Tooltip from '@ndla/tooltip';
4
- import { Additional, ChevronUp, ChevronDown } from '@ndla/icons/common';
2
+ import { Additional, ChevronDown, ChevronUp } from '@ndla/icons/common';
5
3
  import SafeLink from '@ndla/safelink';
4
+ import Tooltip from '@ndla/tooltip';
5
+ import React, { ReactElement, useEffect, useRef, useState } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import ContentTypeBadge from '../ContentTypeBadge';
8
8
  import { ContentTypeResultType, Resource } from '../types';
9
9
  import {
10
10
  highlightStyle,
11
+ noWidthhighlightStyle,
11
12
  showAllButtonStyle,
12
- tooltipStyle,
13
- StyledNoHit,
14
- StyledWrapper,
15
13
  StyledHeader,
16
- StyledListItem,
17
14
  StyledList,
15
+ StyledListItem,
16
+ StyledNoHit,
18
17
  StyledTag,
19
- noWidthhighlightStyle,
18
+ StyledWrapper,
20
19
  } from './ContentTypeResultStyles';
21
20
  import { isPathToHighlight } from './IsPathToHighlight';
22
21
 
23
22
  const renderAdditionalIcon = (label: string, isAdditional?: boolean): ReactElement | null => {
24
23
  if (isAdditional && label) {
25
24
  return (
26
- <Tooltip tooltip={label} align="top" css={tooltipStyle}>
25
+ <Tooltip tooltip={label}>
27
26
  <Additional className="c-icon--20" />
28
27
  </Tooltip>
29
28
  );
@@ -120,8 +120,6 @@ const ActiveFilters = ({
120
120
  <StyledActiveFilterWrapper key={filterKey}>
121
121
  {filterLength > 1 ? (
122
122
  <Tooltip
123
- delay={2000}
124
- align="bottom"
125
123
  tooltip={t('searchPage.searchFilterMessages.removeFilter', {
126
124
  filterName: filter.title,
127
125
  })}>
@@ -139,7 +137,7 @@ const ActiveFilters = ({
139
137
  {filterItems}
140
138
  {filterLength > showFilterCount && (
141
139
  <StyledActiveFilterWrapper>
142
- <Tooltip delay={2000} align="bottom" tooltip={t('searchPage.searchFilterMessages.noValuesButtonText')}>
140
+ <Tooltip tooltip={t('searchPage.searchFilterMessages.noValuesButtonText')}>
143
141
  <Button
144
142
  aria-label={t('searchPage.searchFilterMessages.additionalSubjectFilters', {
145
143
  count: filterLength - showFilterCount + 1,
@@ -16,7 +16,7 @@ import { useTranslation } from 'react-i18next';
16
16
 
17
17
  const Wrapper = styled.div`
18
18
  display: inline-flex;
19
- justify-content: center;
19
+ justify-content: right;
20
20
  align-items: center;
21
21
  flex: 1;
22
22
  ${mq.range({ until: breakpoints.tablet })} {
@@ -64,12 +64,12 @@ export const TopicIntroduction = ({
64
64
  {contentTypeDescription}
65
65
  </span>
66
66
  {additional && (
67
- <Tooltip tooltip={t('resource.tooltipAdditionalTopic')} align="left">
67
+ <Tooltip tooltip={t('resource.tooltipAdditionalTopic')}>
68
68
  <Additional className="c-icon--20 u-margin-left-tiny" />
69
69
  </Tooltip>
70
70
  )}
71
71
  {!additional && showAdditionalCores && (
72
- <Tooltip tooltip={t('resource.tooltipCoreTopic')} align="left">
72
+ <Tooltip tooltip={t('resource.tooltipCoreTopic')}>
73
73
  <Core className="c-icon--20 u-margin-left-tiny" />
74
74
  </Tooltip>
75
75
  )}
@@ -17,11 +17,7 @@ interface Props {
17
17
  const ShortcutItem = ({ shortcut: { id, tooltip, contentType, url, count } }: Props) => {
18
18
  const { t } = useTranslation();
19
19
  return (
20
- <Tooltip
21
- id={`shortcut-tooltip-${id}`}
22
- tooltip={t('resource.shortcutsTooltip', { count })}
23
- delay={100}
24
- align="bottom">
20
+ <Tooltip id={`shortcut-tooltip-${id}`} tooltip={t('resource.shortcutsTooltip', { count })}>
25
21
  <SafeLink {...classes('item-link')} aria-label={tooltip} to={url}>
26
22
  <ContentTypeBadge type={contentType} size="x-small" background />
27
23
  <span {...classes('count')}>{count}</span>