@ndla/ui 50.4.1 → 50.5.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 (73) hide show
  1. package/es/Footer/Footer.js +9 -9
  2. package/es/Footer/FooterLinks.js +8 -8
  3. package/es/FrontpageArticle/FrontpageArticle.js +2 -2
  4. package/es/LearningPaths/LearningPathInformation.js +4 -4
  5. package/es/LearningPaths/LearningPathLastStepNavigation.js +5 -5
  6. package/es/LearningPaths/LearningPathMenuAside.js +5 -5
  7. package/es/LearningPaths/LearningPathMenuContent.js +7 -7
  8. package/es/MediaList/MediaList.js +94 -70
  9. package/es/NDLAFilm/MovieGrid.js +3 -3
  10. package/es/NDLAFilm/filmStyles.js +4 -4
  11. package/es/Resource/BlockResource.js +23 -10
  12. package/es/Resource/ListResource.js +16 -10
  13. package/es/Resource/resourceComponents.js +19 -11
  14. package/es/Subject/SubjectHeader.js +5 -5
  15. package/es/all.css +1 -1
  16. package/es/locale/messages-en.js +6 -3
  17. package/es/locale/messages-nb.js +5 -2
  18. package/es/locale/messages-nn.js +5 -2
  19. package/es/locale/messages-se.js +5 -2
  20. package/es/locale/messages-sma.js +5 -2
  21. package/lib/Footer/Footer.js +9 -9
  22. package/lib/Footer/FooterLinks.js +7 -7
  23. package/lib/FrontpageArticle/FrontpageArticle.js +1 -1
  24. package/lib/LearningPaths/LearningPathInformation.js +4 -4
  25. package/lib/LearningPaths/LearningPathLastStepNavigation.js +4 -4
  26. package/lib/LearningPaths/LearningPathMenuAside.js +5 -5
  27. package/lib/LearningPaths/LearningPathMenuContent.js +7 -7
  28. package/lib/MediaList/MediaList.d.ts +4 -18
  29. package/lib/MediaList/MediaList.js +94 -73
  30. package/lib/NDLAFilm/MovieGrid.js +2 -2
  31. package/lib/NDLAFilm/filmStyles.js +3 -3
  32. package/lib/Resource/BlockResource.d.ts +1 -2
  33. package/lib/Resource/BlockResource.js +22 -9
  34. package/lib/Resource/ListResource.js +15 -9
  35. package/lib/Resource/resourceComponents.js +19 -11
  36. package/lib/Subject/SubjectHeader.js +4 -4
  37. package/lib/all.css +1 -1
  38. package/lib/locale/messages-en.d.ts +3 -0
  39. package/lib/locale/messages-en.js +6 -3
  40. package/lib/locale/messages-nb.d.ts +3 -0
  41. package/lib/locale/messages-nb.js +5 -2
  42. package/lib/locale/messages-nn.d.ts +3 -0
  43. package/lib/locale/messages-nn.js +5 -2
  44. package/lib/locale/messages-se.d.ts +3 -0
  45. package/lib/locale/messages-se.js +5 -2
  46. package/lib/locale/messages-sma.d.ts +3 -0
  47. package/lib/locale/messages-sma.js +5 -2
  48. package/package.json +17 -17
  49. package/src/Footer/Footer.tsx +7 -9
  50. package/src/Footer/FooterLinks.tsx +1 -1
  51. package/src/FrontpageArticle/FrontpageArticle.tsx +3 -3
  52. package/src/LearningPaths/LearningPathInformation.tsx +1 -1
  53. package/src/LearningPaths/LearningPathLastStepNavigation.tsx +2 -2
  54. package/src/LearningPaths/LearningPathMenuAside.tsx +1 -1
  55. package/src/LearningPaths/LearningPathMenuContent.tsx +2 -2
  56. package/src/Logo/component.logo.scss +3 -0
  57. package/src/MediaList/MediaList.tsx +93 -50
  58. package/src/NDLAFilm/MovieGrid.tsx +3 -3
  59. package/src/NDLAFilm/filmStyles.ts +3 -3
  60. package/src/Resource/BlockResource.stories.tsx +0 -3
  61. package/src/Resource/BlockResource.tsx +9 -8
  62. package/src/Resource/ListResource.stories.tsx +0 -3
  63. package/src/Resource/ListResource.tsx +11 -8
  64. package/src/Resource/resourceComponents.tsx +0 -2
  65. package/src/Subject/SubjectHeader.tsx +3 -3
  66. package/src/locale/messages-en.ts +4 -1
  67. package/src/locale/messages-nb.ts +3 -0
  68. package/src/locale/messages-nn.ts +3 -0
  69. package/src/locale/messages-se.ts +3 -0
  70. package/src/locale/messages-sma.ts +3 -0
  71. package/src/main.scss +0 -2
  72. package/src/MediaList/component.medialist.scss +0 -93
  73. package/src/global/components/component.logo.scss +0 -5
@@ -973,8 +973,10 @@ declare const messages: {
973
973
  };
974
974
  publish: string;
975
975
  topic: {
976
+ isDeleted: string;
976
977
  responses: string;
977
978
  topicContent: string;
979
+ fetchMore: string;
978
980
  };
979
981
  posts: {
980
982
  notify: string;
@@ -983,6 +985,7 @@ declare const messages: {
983
985
  edit: string;
984
986
  delete: string;
985
987
  };
988
+ fetchMore: string;
986
989
  };
987
990
  flag: {
988
991
  title: string;
@@ -992,8 +992,10 @@ const messages = {
992
992
  },
993
993
  publish: 'Publish',
994
994
  topic: {
995
+ isDeleted: 'The topic has been deleted and can not be displayed.',
995
996
  responses: 'Responses',
996
- topicContent: 'Write your topic here'
997
+ topicContent: 'Write your topic here',
998
+ fetchMore: 'Fetch more topics'
997
999
  },
998
1000
  posts: {
999
1001
  notify: 'Get notified of new answers',
@@ -1001,7 +1003,8 @@ const messages = {
1001
1003
  report: 'Report post to moderator',
1002
1004
  edit: 'Edit post',
1003
1005
  delete: 'Delete post'
1004
- }
1006
+ },
1007
+ fetchMore: 'Fetch more answers'
1005
1008
  },
1006
1009
  flag: {
1007
1010
  title: 'Report post / comment',
@@ -1031,7 +1034,7 @@ const messages = {
1031
1034
  iconMenu: {
1032
1035
  folders: 'Folders',
1033
1036
  tags: 'Tags',
1034
- subjects: 'Favourite subjects',
1037
+ subjects: 'Subjects',
1035
1038
  profile: 'Profile',
1036
1039
  more: 'More'
1037
1040
  },
@@ -973,8 +973,10 @@ declare const messages: {
973
973
  topic: string;
974
974
  };
975
975
  topic: {
976
+ isDeleted: string;
976
977
  responses: string;
977
978
  topicContent: string;
979
+ fetchMore: string;
978
980
  };
979
981
  posts: {
980
982
  notify: string;
@@ -983,6 +985,7 @@ declare const messages: {
983
985
  edit: string;
984
986
  delete: string;
985
987
  };
988
+ fetchMore: string;
986
989
  };
987
990
  flag: {
988
991
  title: string;
@@ -992,8 +992,10 @@ const messages = {
992
992
  topic: 'Innlegget har blitt oppdatert.'
993
993
  },
994
994
  topic: {
995
+ isDeleted: 'Innlegget har blitt slettet og kan ikke vises.',
995
996
  responses: 'Svar',
996
- topicContent: 'Skriv innlegget ditt her'
997
+ topicContent: 'Skriv innlegget ditt her',
998
+ fetchMore: 'Hent flere innlegg'
997
999
  },
998
1000
  posts: {
999
1001
  notify: 'Få varsel om nye svar',
@@ -1001,7 +1003,8 @@ const messages = {
1001
1003
  report: 'Rapporter innlegg til moderator',
1002
1004
  edit: 'Rediger innlegg',
1003
1005
  delete: 'Slett innlegget'
1004
- }
1006
+ },
1007
+ fetchMore: 'Hent flere svar'
1005
1008
  },
1006
1009
  flag: {
1007
1010
  title: 'Rapporter innlegg / kommentar',
@@ -965,8 +965,10 @@ declare const messages: {
965
965
  topic: string;
966
966
  };
967
967
  topic: {
968
+ isDeleted: string;
968
969
  responses: string;
969
970
  topicContent: string;
971
+ fetchMore: string;
970
972
  };
971
973
  deleted: {
972
974
  post: string;
@@ -983,6 +985,7 @@ declare const messages: {
983
985
  edit: string;
984
986
  delete: string;
985
987
  };
988
+ fetchMore: string;
986
989
  };
987
990
  flag: {
988
991
  title: string;
@@ -984,8 +984,10 @@ const messages = {
984
984
  topic: 'Slett innlegg'
985
985
  },
986
986
  topic: {
987
+ isDeleted: 'Innlegget har vorte sletta og kan ikkje visast.',
987
988
  responses: 'Svar',
988
- topicContent: 'Skriv innlegget ditt her'
989
+ topicContent: 'Skriv innlegget ditt her',
990
+ fetchMore: 'Hent fleire innlegg'
989
991
  },
990
992
  deleted: {
991
993
  post: 'Kommentaren din har blitt sletta.',
@@ -1001,7 +1003,8 @@ const messages = {
1001
1003
  report: 'Rapporter innlegg til moderator',
1002
1004
  edit: 'Rediger innlegg',
1003
1005
  delete: 'Slett innlegget'
1004
- }
1006
+ },
1007
+ fetchMore: 'Hent fleire svar'
1005
1008
  },
1006
1009
  flag: {
1007
1010
  title: 'Rapporter innlegg / kommentar',
@@ -973,8 +973,10 @@ declare const messages: {
973
973
  topic: string;
974
974
  };
975
975
  topic: {
976
+ isDeleted: string;
976
977
  responses: string;
977
978
  topicContent: string;
979
+ fetchMore: string;
978
980
  };
979
981
  posts: {
980
982
  notify: string;
@@ -983,6 +985,7 @@ declare const messages: {
983
985
  edit: string;
984
986
  delete: string;
985
987
  };
988
+ fetchMore: string;
986
989
  };
987
990
  flag: {
988
991
  title: string;
@@ -992,8 +992,10 @@ const messages = {
992
992
  topic: 'Sáhkavuorru lea ođasmahttojuvvon.'
993
993
  },
994
994
  topic: {
995
+ isDeleted: 'Čálus lea sihkojuvvon iige sáhte čájehuvvot.',
995
996
  responses: 'Vástidan',
996
- topicContent: 'Čále sáhkavuoru dása'
997
+ topicContent: 'Čále sáhkavuoru dása',
998
+ fetchMore: 'Viečča eanet čállosiid'
997
999
  },
998
1000
  posts: {
999
1001
  notify: 'Oaččo dieđu ođđa vástádusaid birra',
@@ -1001,7 +1003,8 @@ const messages = {
1001
1003
  report: 'Raportere čállosa moderatorii',
1002
1004
  edit: 'Doaimmat čállosa',
1003
1005
  delete: 'Sihko čállosa'
1004
- }
1006
+ },
1007
+ fetchMore: 'Viečča eanet vástádusaid'
1005
1008
  },
1006
1009
  flag: {
1007
1010
  title: 'Rapportere čállosa / kommentára',
@@ -973,8 +973,10 @@ declare const messages: {
973
973
  topic: string;
974
974
  };
975
975
  topic: {
976
+ isDeleted: string;
976
977
  responses: string;
977
978
  topicContent: string;
979
+ fetchMore: string;
978
980
  };
979
981
  posts: {
980
982
  notify: string;
@@ -983,6 +985,7 @@ declare const messages: {
983
985
  edit: string;
984
986
  delete: string;
985
987
  };
988
+ fetchMore: string;
986
989
  };
987
990
  flag: {
988
991
  title: string;
@@ -992,8 +992,10 @@ const messages = {
992
992
  topic: 'Håaleme lea orrestahteme.'
993
993
  },
994
994
  topic: {
995
+ isDeleted: 'Tjaalege lea sliejhteme jïh ij maehtieh dam vuesiehtidh.',
995
996
  responses: 'Vaestiedasse',
996
- topicContent: 'Tjaelieh dov håalemem daesnie'
997
+ topicContent: 'Tjaelieh dov håalemem daesnie',
998
+ fetchMore: 'Veedtjh jienebh saadtegh'
997
999
  },
998
1000
  posts: {
999
1001
  notify: 'Bïeljelh mejtie orre vaestiedassh',
@@ -1001,7 +1003,8 @@ const messages = {
1001
1003
  report: 'Reekth håalemem moderatovrese',
1002
1004
  edit: 'Jarkelimmie håalemistie',
1003
1005
  delete: 'Slett innlegget'
1004
- }
1006
+ },
1007
+ fetchMore: 'Jienebh vaestiedassh veedtjedh'
1005
1008
  },
1006
1009
  flag: {
1007
1010
  title: 'Påastem reektehtidh / kommentaarem',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "50.4.1",
3
+ "version": "50.5.0",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,23 +31,23 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
- "@ndla/accordion": "^3.0.12",
35
- "@ndla/button": "^12.0.17",
36
- "@ndla/carousel": "^4.0.18",
37
- "@ndla/core": "^4.2.9",
38
- "@ndla/dropdown-menu": "^1.0.19",
39
- "@ndla/forms": "^5.2.7",
34
+ "@ndla/accordion": "^3.0.13",
35
+ "@ndla/button": "^12.0.18",
36
+ "@ndla/carousel": "^4.0.19",
37
+ "@ndla/core": "^4.3.0",
38
+ "@ndla/dropdown-menu": "^1.0.20",
39
+ "@ndla/forms": "^5.2.8",
40
40
  "@ndla/hooks": "^2.1.4",
41
- "@ndla/icons": "^4.2.4",
41
+ "@ndla/icons": "^4.2.5",
42
42
  "@ndla/licenses": "^7.2.4",
43
- "@ndla/modal": "^5.0.17",
44
- "@ndla/notion": "^6.0.18",
45
- "@ndla/safelink": "^4.1.42",
46
- "@ndla/select": "^3.2.4",
47
- "@ndla/switch": "^1.1.25",
48
- "@ndla/tabs": "^3.2.5",
49
- "@ndla/tooltip": "^6.0.7",
50
- "@ndla/typography": "^0.4.2",
43
+ "@ndla/modal": "^5.0.18",
44
+ "@ndla/notion": "^6.0.19",
45
+ "@ndla/safelink": "^4.1.43",
46
+ "@ndla/select": "^3.2.5",
47
+ "@ndla/switch": "^1.1.26",
48
+ "@ndla/tabs": "^3.2.6",
49
+ "@ndla/tooltip": "^6.0.8",
50
+ "@ndla/typography": "^0.4.3",
51
51
  "@ndla/util": "^4.0.3",
52
52
  "@radix-ui/react-popover": "^1.0.7",
53
53
  "@radix-ui/react-slider": "^1.1.2",
@@ -81,5 +81,5 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "gitHead": "e482b4679b927b5dea2d9f149a4a2fc51a907992"
84
+ "gitHead": "33f14792431d5c46241455f1f5e05ac9a81ab7d6"
85
85
  }
@@ -26,17 +26,15 @@ const StyledBackground = styled.div`
26
26
  background: linear-gradient(96deg, rgba(0, 117, 160, 1) 0%, rgba(32, 88, 143, 0) 100%);
27
27
  `;
28
28
 
29
- type StyledFooterProps = {
30
- addMargin?: boolean;
31
- };
32
-
33
- const StyledDiv = styled.div<StyledFooterProps>`
29
+ const StyledDiv = styled.div`
34
30
  color: #fff;
35
31
  position: relative;
36
32
  background: ${colors.brand.dark};
37
33
  overflow: hidden;
38
34
  z-index: 0;
39
- ${(props) => props.addMargin && `margin-top: ${spacingUnit * 4}px;`}
35
+ &[data-margin='true'] {
36
+ margin-top: ${spacing.xxlarge};
37
+ }
40
38
  `;
41
39
 
42
40
  const StyledOneColumn = styled(OneColumn)`
@@ -61,8 +59,8 @@ const StyledFooterHeaderIcon = styled(FooterHeaderIcon)`
61
59
  width: ${spacing.large};
62
60
  height: ${spacing.large};
63
61
  ${mq.range({ from: breakpoints.tabletWide })} {
64
- width: ${spacingUnit * 3}px;
65
- height: ${spacingUnit * 3}px;
62
+ width: ${spacing.xlarge};
63
+ height: ${spacing.xlarge};
66
64
  }
67
65
  `;
68
66
 
@@ -163,7 +161,7 @@ const Footer = ({ children, commonLinks, links, languageSelector, auth, privacyL
163
161
  return (
164
162
  <>
165
163
  <footer>
166
- <StyledDiv addMargin={!languageSelector}>
164
+ <StyledDiv data-margin={!languageSelector}>
167
165
  {languageSelector && <StyledLanguageWrapper>{languageSelector}</StyledLanguageWrapper>}
168
166
  <StyledOneColumn cssModifier="large">{footerContent}</StyledOneColumn>
169
167
  <StyledBackground />
@@ -22,7 +22,7 @@ const StyledLinksWrapper = styled.div`
22
22
  }
23
23
  ${mq.range({ from: breakpoints.desktop })} {
24
24
  div:first-of-type {
25
- margin-right: ${spacingUnit * 4}px;
25
+ margin-right: ${spacing.xxlarge};
26
26
  }
27
27
  }
28
28
  ${mq.range({ until: breakpoints.tabletWide })} {
@@ -43,16 +43,16 @@ const StyledArticle = styled.article`
43
43
  }
44
44
 
45
45
  div[data-type='grid'] + div[data-type='grid'] {
46
- margin-top: ${spacingUnit * 4}px;
46
+ margin-top: ${spacing.xxlarge};
47
47
  }
48
48
 
49
49
  &[data-wide='true'] {
50
50
  max-width: 1100px;
51
51
  h2[id] {
52
- margin-top: ${spacingUnit * 4}px;
52
+ margin-top: ${spacing.xxlarge};
53
53
  }
54
54
  div[data-type='campaign-block'] {
55
- margin: ${spacingUnit * 4}px 0px;
55
+ margin: ${spacing.xxlarge} 0px;
56
56
  }
57
57
  }
58
58
  `;
@@ -22,7 +22,7 @@ const StyledWrapper = styled.div<StyledWrapperProps>`
22
22
  margin: ${spacingUnit * 0.75}px ${spacing.normal} ${spacing.xsmall} 0 !important;
23
23
  ${mq.range({ from: breakpoints.desktop })} {
24
24
  margin: ${spacingUnit * 0.75}px ${spacing.normal} ${spacing.xsmall} 0 !important;
25
- padding: ${spacing.normal} ${spacing.large} ${spacing.large} ${spacingUnit * 4}px;
25
+ padding: ${spacing.normal} ${spacing.large} ${spacing.large} ${spacing.xxlarge};
26
26
  ul {
27
27
  margin-left: ${spacing.normal};
28
28
  }
@@ -10,7 +10,7 @@ import { ReactNode } from 'react';
10
10
  import { useTranslation } from 'react-i18next';
11
11
  import { css } from '@emotion/react';
12
12
  import styled from '@emotion/styled';
13
- import { fonts, spacing, spacingUnit } from '@ndla/core';
13
+ import { fonts, spacing } from '@ndla/core';
14
14
  import SafeLink from '@ndla/safelink';
15
15
  import { OneColumn, LayoutItem } from '../index';
16
16
 
@@ -38,7 +38,7 @@ const StyledLinkWrapper = styled.div`
38
38
 
39
39
  const OneColumnCss = css`
40
40
  background: #fff;
41
- padding-top: ${spacingUnit * 3}px;
41
+ padding-top: ${spacing.xlarge};
42
42
  margin-top: -${spacing.normal};
43
43
  `;
44
44
 
@@ -47,7 +47,7 @@ type StyledAsideProps = {
47
47
 
48
48
  const StyledAside = styled.aside<StyledAsideProps>`
49
49
  display: none;
50
- padding-left: ${spacingUnit * 2.25}px;
50
+ padding-left: ${spacing.xlarge};
51
51
  ${mq.range({ from: breakpoints.desktop })} {
52
52
  display: block;
53
53
  }
@@ -99,7 +99,7 @@ const StyledMenuItem = styled.li<StyledMenuItemProps>`
99
99
  width: 2px;
100
100
  background: ${colors.brand.greyLight};
101
101
  position: absolute;
102
- transform: translate(29px, -${spacingUnit * 3}px);
102
+ transform: translate(29px, -${spacing.xlarge});
103
103
  }
104
104
  ${(props) =>
105
105
  !props.afterCurrent &&
@@ -115,7 +115,7 @@ const StyledMenuItem = styled.li<StyledMenuItemProps>`
115
115
  &:after {
116
116
  width: 4px;
117
117
  background: ${colors.text.light};
118
- transform: translate(28px, -${spacingUnit * 3}px);
118
+ transform: translate(28px, -${spacing.xlarge});
119
119
  }
120
120
  `}
121
121
  ${(props) =>
@@ -1,4 +1,7 @@
1
1
  .c-logo {
2
+ a {
3
+ box-shadow: none;
4
+ }
2
5
  width: 120px;
3
6
  margin: 0;
4
7
  position: relative;
@@ -6,10 +6,9 @@
6
6
  *
7
7
  */
8
8
 
9
- import { ReactNode } from 'react';
10
- import BEMHelper from 'react-bem-helper';
9
+ import { ComponentProps, ReactNode } from 'react';
11
10
  import styled from '@emotion/styled';
12
- import { breakpoints, colors, mq, spacing } from '@ndla/core';
11
+ import { breakpoints, colors, fonts, mq, spacing } from '@ndla/core';
13
12
  import { Launch } from '@ndla/icons/common';
14
13
  import {
15
14
  getLicenseByAbbreviation,
@@ -19,29 +18,40 @@ import {
19
18
  } from '@ndla/licenses';
20
19
  import type { MetaType } from '@ndla/licenses';
21
20
  import { LicenseDescription } from '@ndla/notion';
21
+ import SafeLink from '@ndla/safelink';
22
+ import { Heading, Text } from '@ndla/typography';
22
23
  import { uuid } from '@ndla/util';
23
24
 
24
- const oClasses = new BEMHelper({
25
- name: 'media',
26
- prefix: 'o-',
27
- });
25
+ const StyledMediaList = styled.ul`
26
+ padding-left: 0;
27
+ display: flex;
28
+ flex-direction: column;
29
+ margin: ${spacing.normal} 0;
30
+ `;
28
31
 
29
- const cClasses = new BEMHelper({
30
- name: 'medialist',
31
- prefix: 'c-',
32
- });
32
+ export const MediaList = ({ children, ...rest }: ComponentProps<'ul'>) => (
33
+ <StyledMediaList {...rest}>{children}</StyledMediaList>
34
+ );
33
35
 
34
- interface MediaListProps {
35
- children: ReactNode;
36
- }
36
+ const StyledMediaListItem = styled.li`
37
+ margin-bottom: ${spacing.small};
38
+ padding: ${spacing.small} 0;
39
+ border-bottom: 1px solid ${colors.brand.tertiary};
40
+ ${mq.range({ from: breakpoints.tablet })} {
41
+ display: flex;
42
+ flex-direction: row;
43
+ }
37
44
 
38
- export const MediaList = ({ children }: MediaListProps) => <ul {...cClasses()}>{children}</ul>;
45
+ &:last-of-type {
46
+ border-bottom: none;
47
+ }
48
+ img {
49
+ width: 100%;
50
+ }
51
+ `;
39
52
 
40
- interface MediaListItemProps {
41
- children: ReactNode;
42
- }
43
- export const MediaListItem = ({ children }: MediaListItemProps) => (
44
- <li {...oClasses(undefined, undefined, cClasses('item').className)}>{children}</li>
53
+ export const MediaListItem = ({ children, ...rest }: ComponentProps<'li'>) => (
54
+ <StyledMediaListItem {...rest}>{children}</StyledMediaListItem>
45
55
  );
46
56
 
47
57
  interface MediaListItemImageProps {
@@ -99,16 +109,6 @@ export const MediaListItemImage = ({ children, canOpen }: MediaListItemImageProp
99
109
  </ImageWrapper>
100
110
  );
101
111
 
102
- interface MediaListCCLinkProps {
103
- children: ReactNode;
104
- url: string;
105
- }
106
- export const MediaListCCLink = ({ children, url }: MediaListCCLinkProps) => (
107
- <a rel="noopener noreferrer license" href={url}>
108
- {children}
109
- </a>
110
- );
111
-
112
112
  interface MediaListItemBodyProps {
113
113
  children: ReactNode;
114
114
  license: string;
@@ -121,6 +121,25 @@ interface MediaListItemBodyProps {
121
121
  title?: string;
122
122
  }
123
123
 
124
+ const StyledMediaListItemBody = styled.div`
125
+ ${fonts.size.text.metaText.small};
126
+ ${mq.range({ from: breakpoints.tablet })} {
127
+ max-width: 70%;
128
+ }
129
+ ${mq.range({ from: breakpoints.desktop })} {
130
+ max-width: 75%;
131
+ }
132
+ `;
133
+
134
+ const BodyTitle = styled(Text)`
135
+ color: ${colors.brand.primary};
136
+ font-weight: ${fonts.weight.bold};
137
+ margin-bottom: ${spacing.xsmall};
138
+ + p {
139
+ margin-top: ${spacing.small};
140
+ }
141
+ `;
142
+
124
143
  export const MediaListItemBody = ({
125
144
  children,
126
145
  license: licenseAbbreviation,
@@ -133,34 +152,44 @@ export const MediaListItemBody = ({
133
152
  const license = getLicenseByAbbreviation(licenseAbbreviation, locale);
134
153
  const containerProps = isCreativeCommonsLicense(license.rights)
135
154
  ? {
136
- ...oClasses('body', undefined, cClasses('body').className),
137
155
  'xmlns:cc': 'https://creativecommons.org/ns#',
138
156
  'xmlns:dct': 'http://purl.org/dc/terms/',
139
157
  about: resourceUrl,
140
158
  }
141
- : {
142
- ...oClasses('body', undefined, cClasses('body').className),
143
- };
159
+ : {};
144
160
 
145
161
  const metaResourceType = getResourceTypeNamespace(resourceType);
146
162
 
147
163
  return (
148
- <div {...containerProps}>
164
+ <StyledMediaListItemBody {...containerProps}>
149
165
  {/* @ts-ignore */}
150
166
  {metaResourceType && <span rel="dct:type" href={metaResourceType} style={{ display: 'none' }} />}
151
- {title ? <h3 className="c-medialist__title">{title} </h3> : null}
167
+ {title ? (
168
+ <BodyTitle element="h3" margin="none" textStyle="meta-text-medium">
169
+ {title}
170
+ </BodyTitle>
171
+ ) : null}
152
172
  <LicenseDescription locale={locale} messages={messages} licenseRights={license.rights} highlightCC />
153
- <MediaListCCLink url={license.url}>{license.linkText}</MediaListCCLink>
173
+ <SafeLink rel="noopener noreferrer license" target="_blank" to={license.url}>
174
+ {license.linkText}
175
+ </SafeLink>
154
176
  {children}
155
- </div>
177
+ </StyledMediaListItemBody>
156
178
  );
157
179
  };
158
180
 
159
- interface MediaListItemActionsProps {
160
- children: ReactNode;
161
- }
162
- export const MediaListItemActions = ({ children }: MediaListItemActionsProps) => (
163
- <div {...cClasses('actions')}>{children}</div>
181
+ const StyledMediaListItemActions = styled.div`
182
+ margin: ${spacing.small} 0;
183
+ list-style: none;
184
+ width: 100%;
185
+ button,
186
+ a {
187
+ margin: 0 ${spacing.small} ${spacing.small} 0;
188
+ }
189
+ `;
190
+
191
+ export const MediaListItemActions = ({ children, ...rest }: ComponentProps<'div'>) => (
192
+ <StyledMediaListItemActions {...rest}>{children}</StyledMediaListItemActions>
164
193
  );
165
194
 
166
195
  const isLink = (text: string) => text.startsWith('http') || text.startsWith('https');
@@ -173,9 +202,9 @@ interface HandleLinkProps {
173
202
  export const HandleLink = ({ text, children }: HandleLinkProps) => {
174
203
  if (isLink(text)) {
175
204
  return (
176
- <a href={text} target="_blank" rel="noopener noreferrer">
205
+ <SafeLink to={text} target="_blank" rel="noopener noreferrer">
177
206
  {children}
178
- </a>
207
+ </SafeLink>
179
208
  );
180
209
  }
181
210
  return <span>{children}</span>;
@@ -221,18 +250,32 @@ function isAttributionItem(item: ItemType): item is ItemTypeWithDescription {
221
250
  return attributionTypes.some((type) => type === item.metaType);
222
251
  }
223
252
 
253
+ const StyledMediaListItemMeta = styled.ul`
254
+ margin: ${spacing.small} 0;
255
+ list-style: none;
256
+ width: 100%;
257
+ button,
258
+ a {
259
+ margin: 0 ${spacing.small} ${spacing.small} 0;
260
+ }
261
+ `;
262
+
263
+ const StyledMediaListMetaItem = styled.li`
264
+ margin: 0;
265
+ padding: 0;
266
+ `;
267
+
224
268
  export const MediaListItemMeta = ({ items = [] }: MediaListItemMetaProps) => {
225
269
  const attributionItems = items.filter(isAttributionItem);
226
270
  const attributionMeta = attributionItems.map((item) => `${item.label}: ${item.description}`).join(', ');
227
271
 
228
272
  return (
229
- // eslint-disable-next-line react/no-unknown-property
230
- <ul {...cClasses('actions')} property="cc:attributionName" content={attributionMeta}>
273
+ <StyledMediaListItemMeta property="cc:attributionName" content={attributionMeta}>
231
274
  {items.map((item) => (
232
- <li key={uuid()} className="c-medialist__meta-item">
275
+ <StyledMediaListMetaItem key={uuid()}>
233
276
  <ItemText item={item} />
234
- </li>
277
+ </StyledMediaListMetaItem>
235
278
  ))}
236
- </ul>
279
+ </StyledMediaListItemMeta>
237
280
  );
238
281
  };
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { useTranslation } from 'react-i18next';
10
10
  import styled from '@emotion/styled';
11
- import { breakpoints, mq, spacing, spacingUnit } from '@ndla/core';
11
+ import { breakpoints, mq, spacing } from '@ndla/core';
12
12
  import FilmContentCard from './FilmContentCard';
13
13
  import { setAnimations, StyledHeadingH1 } from './filmStyles';
14
14
  import { MovieResourceType, MovieType } from './types';
@@ -27,8 +27,8 @@ const MovieListing = styled.div<MovieListingProps>`
27
27
  margin-left: ${spacing.normal};
28
28
  margin-right: ${spacing.normal};
29
29
  ${mq.range({ from: breakpoints.desktop })} {
30
- margin-left: ${spacingUnit * 3}px;
31
- margin-right: ${spacingUnit * 3}px;
30
+ margin-left: ${spacing.xlarge};
31
+ margin-right: ${spacing.xlarge};
32
32
  }
33
33
  > div {
34
34
  opacity: 0;