@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
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { css } from '@emotion/react';
10
10
  import styled from '@emotion/styled';
11
- import { fonts, spacing, colors, mq, breakpoints, spacingUnit } from '@ndla/core';
11
+ import { fonts, spacing, colors, mq, breakpoints } from '@ndla/core';
12
12
 
13
13
  export const setAnimations = () => {
14
14
  const styles: any = {};
@@ -35,8 +35,8 @@ const headingStyle = css`
35
35
  margin-left: ${spacing.normal};
36
36
  margin-right: ${spacing.normal};
37
37
  ${mq.range({ from: breakpoints.desktop })} {
38
- margin-left: ${spacingUnit * 3}px;
39
- margin-right: ${spacingUnit * 3}px;
38
+ margin-left: ${spacing.xlarge};
39
+ margin-right: ${spacing.xlarge};
40
40
  }
41
41
  `;
42
42
 
@@ -27,9 +27,6 @@ export default {
27
27
  resourceTypes: {
28
28
  control: false,
29
29
  },
30
- headingLevel: {
31
- control: false,
32
- },
33
30
  menu: {
34
31
  control: false,
35
32
  },
@@ -8,7 +8,8 @@
8
8
 
9
9
  import { ReactNode } from 'react';
10
10
  import styled from '@emotion/styled';
11
- import { colors, fonts, spacing } from '@ndla/core';
11
+ import { colors, spacing } from '@ndla/core';
12
+ import { Text } from '@ndla/typography';
12
13
  import {
13
14
  CompressedTagList,
14
15
  ResourceImageProps,
@@ -58,12 +59,10 @@ const BlockElementWrapper = styled.div`
58
59
  }
59
60
  `;
60
61
 
61
- const BlockDescription = styled.p`
62
+ const BlockDescription = styled(Text)`
62
63
  display: -webkit-box;
63
64
  line-clamp: 2;
64
- ${fonts.sizes(16)};
65
65
  height: 0em;
66
- margin: 0;
67
66
  overflow: hidden;
68
67
  text-overflow: ellipsis;
69
68
  transition: height 0.2s ease-out;
@@ -146,7 +145,6 @@ interface Props {
146
145
  resourceImage: ResourceImageProps;
147
146
  tags?: string[];
148
147
  description?: string;
149
- headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
150
148
  menu?: ReactNode;
151
149
  isLoading?: boolean;
152
150
  targetBlank?: boolean;
@@ -163,7 +161,6 @@ const BlockResource = ({
163
161
  description,
164
162
  menu,
165
163
  isLoading,
166
- headingLevel: Heading = 'h2',
167
164
  targetBlank,
168
165
  resourceTypes,
169
166
  }: Props) => {
@@ -186,11 +183,15 @@ const BlockResource = ({
186
183
  <ContentWrapper>
187
184
  <ResourceTypeAndTitleLoader loading={isLoading}>
188
185
  <ResourceTitleLink data-link="" title={title} target={targetBlank ? '_blank' : undefined} to={link}>
189
- <Heading css={resourceHeadingStyle}>{title}</Heading>
186
+ <Text element="span" textStyle="label-small" css={resourceHeadingStyle}>
187
+ {title}
188
+ </Text>
190
189
  </ResourceTitleLink>
191
190
  </ResourceTypeAndTitleLoader>
192
191
  <ResourceTypeList resourceTypes={resourceTypes} />
193
- <BlockDescription data-description="">{description}</BlockDescription>
192
+ <BlockDescription element="p" textStyle="meta-text-small" margin="none" data-description="">
193
+ {description}
194
+ </BlockDescription>
194
195
  </ContentWrapper>
195
196
  <TagsAndActionMenu>
196
197
  {tags && tags.length > 0 && <CompressedTagList tagLinkPrefix={tagLinkPrefix} tags={tags} />}
@@ -27,9 +27,6 @@ export default {
27
27
  resourceTypes: {
28
28
  control: false,
29
29
  },
30
- headingLevel: {
31
- control: false,
32
- },
33
30
  menu: {
34
31
  control: false,
35
32
  },
@@ -8,7 +8,8 @@
8
8
 
9
9
  import { ReactNode } from 'react';
10
10
  import styled from '@emotion/styled';
11
- import { fonts, spacing, colors, breakpoints, mq } from '@ndla/core';
11
+ import { spacing, colors, breakpoints, mq } from '@ndla/core';
12
+ import { Text } from '@ndla/typography';
12
13
  import {
13
14
  CompressedTagList,
14
15
  ResourceImageProps,
@@ -81,17 +82,15 @@ const StyledImage = styled(Image)`
81
82
  aspect-ratio: 4/3;
82
83
  `;
83
84
 
84
- const StyledResourceDescription = styled.p`
85
+ const StyledResourceDescription = styled(Text)`
85
86
  grid-area: description;
86
87
  line-clamp: 2;
87
- line-height: 1em;
88
88
  height: 3.1em;
89
89
  margin: 0 ${spacing.small} ${spacing.small} 0;
90
90
  ${mq.range({ until: breakpoints.mobileWide })} {
91
91
  margin: 0 ${spacing.small};
92
92
  }
93
93
  overflow: hidden;
94
- ${fonts.sizes(16)};
95
94
  text-overflow: ellipsis;
96
95
  // Unfortunate css needed for multi-line text overflow ellipsis.
97
96
  display: -webkit-box;
@@ -190,7 +189,11 @@ const Description = ({ description, loading }: ResourceDescriptionProps) => {
190
189
  </ContentLoader>
191
190
  );
192
191
  }
193
- return <StyledResourceDescription>{description}</StyledResourceDescription>;
192
+ return (
193
+ <StyledResourceDescription element="p" textStyle="meta-text-small">
194
+ {description}
195
+ </StyledResourceDescription>
196
+ );
194
197
  };
195
198
 
196
199
  export interface ListResourceProps {
@@ -227,7 +230,7 @@ const ListResource = ({
227
230
 
228
231
  return (
229
232
  <ListResourceWrapper id={id}>
230
- <ImageWrapper imageSize={imageType}>
233
+ <ImageWrapper imageSize={imageType} data-image-size={imageType}>
231
234
  <ListResourceImage
232
235
  resourceImage={resourceImage}
233
236
  loading={isLoading}
@@ -239,9 +242,9 @@ const ListResource = ({
239
242
  <TopicAndTitleWrapper>
240
243
  <TypeAndTitleLoader loading={isLoading}>
241
244
  <StyledLink to={link} data-link="" target={targetBlank ? '_blank' : undefined}>
242
- <h1 css={resourceHeadingStyle} title={title}>
245
+ <Text element="span" textStyle="label-small" css={resourceHeadingStyle} title={title}>
243
246
  {title}
244
- </h1>
247
+ </Text>
245
248
  </StyledLink>
246
249
  <ResourceTypeList resourceTypes={resourceTypes} />
247
250
  </TypeAndTitleLoader>
@@ -46,7 +46,6 @@ export const resourceHeadingStyle = css`
46
46
  margin: 0;
47
47
  overflow: hidden;
48
48
  text-overflow: ellipsis;
49
- font-weight: ${fonts.weight.bold};
50
49
  // Unfortunate css needed for multi-line text overflow ellipsis.
51
50
  line-height: 1;
52
51
  display: -webkit-box;
@@ -54,7 +53,6 @@ export const resourceHeadingStyle = css`
54
53
  line-clamp: 1;
55
54
  -webkit-box-orient: vertical;
56
55
  grid-area: resourceTitle;
57
- ${fonts.sizes('16px', '20px')};
58
56
  `;
59
57
 
60
58
  const StyledTagList = styled.ul`
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { css } from '@emotion/react';
10
10
  import styled from '@emotion/styled';
11
- import { colors, fonts, mq, spacing, spacingUnit, breakpoints } from '@ndla/core';
11
+ import { colors, fonts, mq, spacing, breakpoints } from '@ndla/core';
12
12
  import OneColumn from '../Layout/OneColumn';
13
13
 
14
14
  type Types = 'mobile' | 'tablet' | 'desktop' | 'wide';
@@ -77,12 +77,12 @@ const StyledHeading = styled.h1`
77
77
  ${mq.range({ from: breakpoints.tablet })} {
78
78
  margin: 0;
79
79
  ${fonts.sizes('40px', '40px')};
80
- padding: 0 0 0 ${spacingUnit * 3}px;
80
+ padding: 0 0 0 ${spacing.xlarge};
81
81
  }
82
82
  ${mq.range({ from: breakpoints.desktop })} {
83
83
  margin: 0;
84
84
  ${fonts.sizes('52px', '52px')};
85
- padding: 0 0 0 ${spacingUnit * 3}px;
85
+ padding: 0 0 0 ${spacing.xlarge};
86
86
  }
87
87
  `;
88
88
 
@@ -999,8 +999,10 @@ const messages = {
999
999
  },
1000
1000
  publish: 'Publish',
1001
1001
  topic: {
1002
+ isDeleted: 'The topic has been deleted and can not be displayed.',
1002
1003
  responses: 'Responses',
1003
1004
  topicContent: 'Write your topic here',
1005
+ fetchMore: 'Fetch more topics',
1004
1006
  },
1005
1007
  posts: {
1006
1008
  notify: 'Get notified of new answers',
@@ -1009,6 +1011,7 @@ const messages = {
1009
1011
  edit: 'Edit post',
1010
1012
  delete: 'Delete post',
1011
1013
  },
1014
+ fetchMore: 'Fetch more answers',
1012
1015
  },
1013
1016
  flag: {
1014
1017
  title: 'Report post / comment',
@@ -1042,7 +1045,7 @@ const messages = {
1042
1045
  iconMenu: {
1043
1046
  folders: 'Folders',
1044
1047
  tags: 'Tags',
1045
- subjects: 'Favourite subjects',
1048
+ subjects: 'Subjects',
1046
1049
  profile: 'Profile',
1047
1050
  more: 'More',
1048
1051
  },
@@ -998,8 +998,10 @@ const messages = {
998
998
  topic: 'Innlegget har blitt oppdatert.',
999
999
  },
1000
1000
  topic: {
1001
+ isDeleted: 'Innlegget har blitt slettet og kan ikke vises.',
1001
1002
  responses: 'Svar',
1002
1003
  topicContent: 'Skriv innlegget ditt her',
1004
+ fetchMore: 'Hent flere innlegg',
1003
1005
  },
1004
1006
  posts: {
1005
1007
  notify: 'Få varsel om nye svar',
@@ -1008,6 +1010,7 @@ const messages = {
1008
1010
  edit: 'Rediger innlegg',
1009
1011
  delete: 'Slett innlegget',
1010
1012
  },
1013
+ fetchMore: 'Hent flere svar',
1011
1014
  },
1012
1015
  flag: {
1013
1016
  title: 'Rapporter innlegg / kommentar',
@@ -990,8 +990,10 @@ const messages = {
990
990
  topic: 'Slett innlegg',
991
991
  },
992
992
  topic: {
993
+ isDeleted: 'Innlegget har vorte sletta og kan ikkje visast.',
993
994
  responses: 'Svar',
994
995
  topicContent: 'Skriv innlegget ditt her',
996
+ fetchMore: 'Hent fleire innlegg',
995
997
  },
996
998
  deleted: {
997
999
  post: 'Kommentaren din har blitt sletta.',
@@ -1008,6 +1010,7 @@ const messages = {
1008
1010
  edit: 'Rediger innlegg',
1009
1011
  delete: 'Slett innlegget',
1010
1012
  },
1013
+ fetchMore: 'Hent fleire svar',
1011
1014
  },
1012
1015
  flag: {
1013
1016
  title: 'Rapporter innlegg / kommentar',
@@ -1000,8 +1000,10 @@ const messages = {
1000
1000
  topic: 'Sáhkavuorru lea ođasmahttojuvvon.',
1001
1001
  },
1002
1002
  topic: {
1003
+ isDeleted: 'Čálus lea sihkojuvvon iige sáhte čájehuvvot.',
1003
1004
  responses: 'Vástidan',
1004
1005
  topicContent: 'Čále sáhkavuoru dása',
1006
+ fetchMore: 'Viečča eanet čállosiid',
1005
1007
  },
1006
1008
  posts: {
1007
1009
  notify: 'Oaččo dieđu ođđa vástádusaid birra',
@@ -1010,6 +1012,7 @@ const messages = {
1010
1012
  edit: 'Doaimmat čállosa',
1011
1013
  delete: 'Sihko čállosa',
1012
1014
  },
1015
+ fetchMore: 'Viečča eanet vástádusaid',
1013
1016
  },
1014
1017
  flag: {
1015
1018
  title: 'Rapportere čállosa / kommentára',
@@ -1002,8 +1002,10 @@ const messages = {
1002
1002
  topic: 'Håaleme lea orrestahteme.',
1003
1003
  },
1004
1004
  topic: {
1005
+ isDeleted: 'Tjaalege lea sliejhteme jïh ij maehtieh dam vuesiehtidh.',
1005
1006
  responses: 'Vaestiedasse',
1006
1007
  topicContent: 'Tjaelieh dov håalemem daesnie',
1008
+ fetchMore: 'Veedtjh jienebh saadtegh',
1007
1009
  },
1008
1010
  posts: {
1009
1011
  notify: 'Bïeljelh mejtie orre vaestiedassh',
@@ -1012,6 +1014,7 @@ const messages = {
1012
1014
  edit: 'Jarkelimmie håalemistie',
1013
1015
  delete: 'Slett innlegget',
1014
1016
  },
1017
+ fetchMore: 'Jienebh vaestiedassh veedtjedh',
1015
1018
  },
1016
1019
  flag: {
1017
1020
  title: 'Påastem reektehtidh / kommentaarem',
package/src/main.scss CHANGED
@@ -7,8 +7,6 @@
7
7
  @import 'global/components/component.bodybox';
8
8
  @import 'Figure/component.figure';
9
9
  @import 'Aside/component.aside';
10
- @import 'global/components/component.logo';
11
- @import 'MediaList/component.medialist';
12
10
  @import 'ContentTypeBadge/component.content-type-badge';
13
11
  @import 'Filter/component.filter';
14
12
  @import 'Search/component.search';
@@ -1,93 +0,0 @@
1
- /**
2
- ** MEDIALIST
3
- ** List all types of media (used in general license box)
4
- **/
5
-
6
- .c-medialist {
7
- padding-left: 0;
8
- display: flex;
9
- flex-direction: column;
10
- margin: $spacing 0;
11
- }
12
-
13
- .c-medialist__item {
14
- margin-bottom: $spacing--small;
15
- padding: $spacing--small 0;
16
- border-bottom: 1px solid $brand-color--tertiary;
17
- @include mq(tablet) {
18
- display: flex;
19
- flex-direction: row;
20
- }
21
-
22
- &:last-child {
23
- border-bottom: none;
24
- }
25
- img {
26
- width: 100%;
27
- }
28
- }
29
-
30
- .c-medialist__body {
31
- @include font-size(14px, 24px);
32
- @include mq(tablet) {
33
- max-width: 70% !important;
34
- }
35
- @include mq(970px) {
36
- max-width: 75% !important;
37
- }
38
- }
39
-
40
- .c-medialist__actions {
41
- margin-top: $spacing--small;
42
- margin-bottom: $spacing--small;
43
- margin-left: 0;
44
- padding-left: 0;
45
- list-style: none;
46
- width: 100%;
47
- button,
48
- a {
49
- margin: 0 $spacing--small $spacing--small 0;
50
- }
51
- }
52
- .c-medialist__meta {
53
- margin-bottom: $spacing--small;
54
- padding-bottom: $spacing--small;
55
- }
56
- .c-medialist__meta-item {
57
- width: 100%;
58
- padding-right: $spacing--small;
59
- margin: $spacing--small / 4 0;
60
- line-height: 1.1rem;
61
- }
62
- .c-medialist__ref {
63
- background: $white;
64
- padding: $spacing--small $spacing;
65
- @include mq(tablet) {
66
- padding-left: $spacing--small + 24px;
67
- }
68
- margin-top: $spacing--small;
69
- margin-right: $spacing;
70
- width: 100%;
71
- @include mq($until: tablet) {
72
- button,
73
- a {
74
- width: 100%;
75
- margin: $spacing--small / 4 0;
76
- }
77
- }
78
- }
79
- .c-medialist__icon {
80
- color: $brand-color;
81
- width: $spacing * 3;
82
- height: auto !important;
83
- margin: $spacing;
84
- }
85
- .c-medialist__title {
86
- margin-top: 0;
87
- margin-bottom: $spacing--small/2;
88
- @include font-size(16px, 1.5);
89
- color: $brand-color;
90
- + p {
91
- margin-top: 0;
92
- }
93
- }
@@ -1,5 +0,0 @@
1
- .c-logo {
2
- a {
3
- box-shadow: none;
4
- }
5
- }