@ndla/ui 39.1.1 → 41.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 (70) hide show
  1. package/es/Article/Article.js +6 -5
  2. package/es/Article/ArticleHeaderWrapper.js +3 -64
  3. package/es/Frontpage/FrontpageAllSubjects.js +17 -10
  4. package/es/LearningPaths/LearningPathInformation.js +10 -6
  5. package/es/LearningPaths/LearningPathMenuModalWrapper.js +2 -2
  6. package/es/Masthead/MastheadSearchModal.js +2 -2
  7. package/es/MultidisciplinarySubject/MultidisciplinarySubject.js +14 -19
  8. package/es/Navigation/index.js +1 -2
  9. package/es/Programme/Programme.js +13 -8
  10. package/es/ToolboxPage/ToolboxInfo.js +4 -9
  11. package/es/Topic/Topic.js +21 -18
  12. package/es/Translation/index.js +0 -1
  13. package/es/all.css +1 -1
  14. package/es/index.js +2 -3
  15. package/lib/Article/Article.d.ts +3 -10
  16. package/lib/Article/Article.js +6 -5
  17. package/lib/Article/ArticleHeaderWrapper.d.ts +3 -11
  18. package/lib/Article/ArticleHeaderWrapper.js +11 -71
  19. package/lib/Frontpage/FrontpageAllSubjects.js +17 -10
  20. package/lib/LearningPaths/LearningPathInformation.js +9 -5
  21. package/lib/LearningPaths/LearningPathMenuModalWrapper.d.ts +2 -2
  22. package/lib/LearningPaths/LearningPathMenuModalWrapper.js +2 -2
  23. package/lib/Masthead/MastheadSearchModal.d.ts +2 -2
  24. package/lib/Masthead/MastheadSearchModal.js +2 -2
  25. package/lib/MultidisciplinarySubject/MultidisciplinarySubject.js +14 -19
  26. package/lib/Navigation/index.d.ts +1 -2
  27. package/lib/Navigation/index.js +0 -7
  28. package/lib/Programme/Programme.js +12 -7
  29. package/lib/ToolboxPage/ToolboxInfo.js +5 -10
  30. package/lib/Topic/Topic.js +21 -18
  31. package/lib/Translation/index.d.ts +0 -1
  32. package/lib/Translation/index.js +0 -7
  33. package/lib/all.css +1 -1
  34. package/lib/index.d.ts +2 -3
  35. package/lib/index.js +0 -19
  36. package/package.json +14 -14
  37. package/src/Article/Article.tsx +7 -9
  38. package/src/Article/ArticleHeaderWrapper.tsx +4 -52
  39. package/src/Dialog/component.dialog.scss +0 -4
  40. package/src/Frontpage/FrontpageAllSubjects.tsx +3 -21
  41. package/src/LearningPaths/LearningPathInformation.tsx +6 -12
  42. package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +2 -2
  43. package/src/Masthead/MastheadSearchModal.tsx +2 -2
  44. package/src/MultidisciplinarySubject/MultidisciplinarySubject.tsx +3 -19
  45. package/src/Navigation/index.ts +1 -2
  46. package/src/Programme/Programme.tsx +4 -2
  47. package/src/Search/component.search-result.scss +0 -8
  48. package/src/ToolboxPage/ToolboxInfo.tsx +2 -13
  49. package/src/Topic/Topic.tsx +3 -2
  50. package/src/Translation/index.ts +0 -1
  51. package/src/all.scss +0 -1
  52. package/src/index.ts +2 -4
  53. package/src/main.scss +0 -1
  54. package/es/CompetenceGoals/CompetenceGoalsDialog.js +0 -79
  55. package/es/CompetenceGoals/index.js +0 -1
  56. package/es/Navigation/NavigationHeading.js +0 -50
  57. package/es/Translation/TranslationBox.js +0 -16
  58. package/lib/CompetenceGoals/CompetenceGoalsDialog.d.ts +0 -8
  59. package/lib/CompetenceGoals/CompetenceGoalsDialog.js +0 -84
  60. package/lib/CompetenceGoals/index.d.ts +0 -1
  61. package/lib/CompetenceGoals/index.js +0 -13
  62. package/lib/Navigation/NavigationHeading.d.ts +0 -9
  63. package/lib/Navigation/NavigationHeading.js +0 -58
  64. package/lib/Translation/TranslationBox.d.ts +0 -10
  65. package/lib/Translation/TranslationBox.js +0 -24
  66. package/src/CompetenceGoals/CompetenceGoalsDialog.tsx +0 -70
  67. package/src/CompetenceGoals/index.ts +0 -1
  68. package/src/Navigation/NavigationHeading.tsx +0 -49
  69. package/src/Translation/TranslationBox.tsx +0 -19
  70. package/src/Translation/component.translation-box.scss +0 -9
package/lib/index.d.ts CHANGED
@@ -8,7 +8,6 @@
8
8
  export { default as SectionHeading } from './SectionHeading';
9
9
  export { ConceptNotionV2, ImageEmbed, AudioEmbed, H5pEmbed, ExternalEmbed, IframeEmbed, FootnoteEmbed, BrightcoveEmbed, ContentLinkEmbed, RelatedContentEmbed, ConceptEmbed, ConceptListEmbed, UnknownEmbed, } from './Embed';
10
10
  export { ArticleByline, ArticleContent, ArticleFootNotes, ArticleIntroduction, ArticleTitle, ArticleWrapper, ArticleHeaderWrapper, ArticleSideBar, default as Article, } from './Article';
11
- export { CompetenceGoalsDialog } from './CompetenceGoals';
12
11
  export { default as Table } from './Table';
13
12
  export { default as ResourcesWrapper, ResourcesTopicTitle } from './ResourcesWrapper';
14
13
  export { createUniversalPortal } from './utils/createUniversalPortal';
@@ -35,7 +34,7 @@ export { Figure, FigureCaption, FigureLicenseDialog, FigureExpandButton, FigureO
35
34
  export type { FigureType } from './Figure';
36
35
  export { LanguageSelector } from './LanguageSelector';
37
36
  export { LearningPathWrapper, LearningPathContent, LearningPathMenu, LearningPathSticky, LearningPathInformation, LearningPathStickySibling, LearningPathStickyPlaceholder, LearningPathLastStepNavigation, LearningPathMobileStepInfo, LearningPathMobileHeader, } from './LearningPaths';
38
- export { Translation, TranslationLine, TranslationBox } from './Translation';
37
+ export { Translation, TranslationLine } from './Translation';
39
38
  export { default as SearchResultSleeve } from './Search/SearchResultSleeve';
40
39
  export { default as ContentTypeResult } from './Search/ContentTypeResult';
41
40
  export { SearchFieldForm } from './Search/SearchFieldForm';
@@ -48,7 +47,7 @@ export { default as Breadcrumblist } from './Breadcrumblist';
48
47
  export { MessageBox, MessageBoxTag, MessageBanner } from './Messages';
49
48
  export { ResourceBox } from './ResourceBox';
50
49
  export { default as AudioPlayer, initAudioPlayers } from './AudioPlayer';
51
- export { NavigationHeading, NavigationBox, NavigationTopicAbout } from './Navigation';
50
+ export { NavigationBox, NavigationTopicAbout } from './Navigation';
52
51
  export { default as Programme } from './Programme';
53
52
  export { default as CompetenceGoalTab } from './CompetenceGoalTab';
54
53
  export { default as MultidisciplinarySubject, MultidisciplinarySubjectHeader } from './MultidisciplinarySubject';
package/lib/index.js CHANGED
@@ -184,12 +184,6 @@ Object.defineProperty(exports, "CompetenceGoalTab", {
184
184
  return _CompetenceGoalTab["default"];
185
185
  }
186
186
  });
187
- Object.defineProperty(exports, "CompetenceGoalsDialog", {
188
- enumerable: true,
189
- get: function get() {
190
- return _CompetenceGoals.CompetenceGoalsDialog;
191
- }
192
- });
193
187
  Object.defineProperty(exports, "ConceptEmbed", {
194
188
  enumerable: true,
195
189
  get: function get() {
@@ -808,12 +802,6 @@ Object.defineProperty(exports, "NavigationBox", {
808
802
  return _Navigation.NavigationBox;
809
803
  }
810
804
  });
811
- Object.defineProperty(exports, "NavigationHeading", {
812
- enumerable: true,
813
- get: function get() {
814
- return _Navigation.NavigationHeading;
815
- }
816
- });
817
805
  Object.defineProperty(exports, "NavigationTopicAbout", {
818
806
  enumerable: true,
819
807
  get: function get() {
@@ -1180,12 +1168,6 @@ Object.defineProperty(exports, "Translation", {
1180
1168
  return _Translation.Translation;
1181
1169
  }
1182
1170
  });
1183
- Object.defineProperty(exports, "TranslationBox", {
1184
- enumerable: true,
1185
- get: function get() {
1186
- return _Translation.TranslationBox;
1187
- }
1188
- });
1189
1171
  Object.defineProperty(exports, "TranslationLine", {
1190
1172
  enumerable: true,
1191
1173
  get: function get() {
@@ -1309,7 +1291,6 @@ Object.defineProperty(exports, "useSnack", {
1309
1291
  var _SectionHeading = _interopRequireDefault(require("./SectionHeading"));
1310
1292
  var _Embed = require("./Embed");
1311
1293
  var _Article = _interopRequireWildcard(require("./Article"));
1312
- var _CompetenceGoals = require("./CompetenceGoals");
1313
1294
  var _Table = _interopRequireDefault(require("./Table"));
1314
1295
  var _ResourcesWrapper = _interopRequireWildcard(require("./ResourcesWrapper"));
1315
1296
  var _createUniversalPortal = require("./utils/createUniversalPortal");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "39.1.1",
3
+ "version": "41.0.0",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,21 +31,21 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
- "@ndla/accordion": "^2.2.6",
34
+ "@ndla/accordion": "^2.2.7",
35
35
  "@ndla/article-scripts": "^3.0.18",
36
- "@ndla/button": "^10.1.5",
37
- "@ndla/carousel": "^3.1.3",
38
- "@ndla/core": "^4.0.1",
39
- "@ndla/forms": "^4.3.5",
36
+ "@ndla/button": "^10.1.6",
37
+ "@ndla/carousel": "^3.1.4",
38
+ "@ndla/core": "^4.1.0",
39
+ "@ndla/forms": "^4.3.6",
40
40
  "@ndla/hooks": "^2.0.7",
41
- "@ndla/icons": "^3.0.1",
41
+ "@ndla/icons": "^3.0.2",
42
42
  "@ndla/licenses": "^7.0.4",
43
- "@ndla/modal": "^3.0.2",
44
- "@ndla/notion": "^5.0.2",
45
- "@ndla/safelink": "^4.1.5",
46
- "@ndla/switch": "^1.1.3",
47
- "@ndla/tabs": "^2.2.5",
48
- "@ndla/tooltip": "^4.1.5",
43
+ "@ndla/modal": "^3.0.4",
44
+ "@ndla/notion": "^5.0.4",
45
+ "@ndla/safelink": "^4.1.6",
46
+ "@ndla/switch": "^1.1.4",
47
+ "@ndla/tabs": "^3.0.0",
48
+ "@ndla/tooltip": "^4.1.6",
49
49
  "@ndla/util": "^3.1.13",
50
50
  "@radix-ui/react-dropdown-menu": "^2.0.5",
51
51
  "@radix-ui/react-popover": "^1.0.6",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "b3348cc442cf427e291831f03c51d7ab2e3bbbed"
88
+ "gitHead": "982a8c9b737182c8c1b4f1105ed128be637d47cb"
89
89
  }
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
 
9
- import React, { ComponentType, ReactNode, useEffect, useRef, useState, forwardRef } from 'react';
9
+ import React, { ReactNode, useEffect, useRef, useState, forwardRef } from 'react';
10
10
  import BEMHelper from 'react-bem-helper';
11
11
  import parse from 'html-react-parser';
12
12
  import styled from '@emotion/styled';
@@ -23,6 +23,7 @@ import ArticleNotions, { NotionRelatedContent } from './ArticleNotions';
23
23
  import ArticleAccessMessage from './ArticleAccessMessage';
24
24
  import MessageBox from '../Messages/MessageBox';
25
25
  import { ConceptNotionType } from '../Notion/ConceptNotion';
26
+ import { Heading } from '../Typography';
26
27
 
27
28
  const classes = new BEMHelper({
28
29
  name: 'article',
@@ -63,7 +64,9 @@ export const ArticleTitle = ({ children, icon, label }: ArticleTitleProps) => {
63
64
  <div {...classes('title', modifiers)}>
64
65
  {icon}
65
66
  {labelView}
66
- <h1 tabIndex={-1}>{children}</h1>
67
+ <Heading element="h1" headingStyle="h1" tabIndex={-1}>
68
+ {children}
69
+ </Heading>
67
70
  </div>
68
71
  );
69
72
  };
@@ -117,17 +120,13 @@ type Props = {
117
120
  article: ArticleType;
118
121
  icon?: ReactNode;
119
122
  licenseBox?: ReactNode;
120
- competenceGoalsLoading?: boolean;
121
123
  modifier?: string;
122
124
  children?: ReactNode;
123
125
  messages: Messages;
124
126
  contentTransformed?: boolean;
125
127
  locale: Locale;
126
128
  messageBoxLinks?: [];
127
- competenceGoals?: (inp: {
128
- Dialog: ComponentType;
129
- dialogProps: { isOpen: boolean; onClose: () => void };
130
- }) => ReactNode;
129
+ competenceGoals?: ReactNode;
131
130
  id: string;
132
131
  renderMarkdown: (text: string) => string;
133
132
  notions?: { list: ConceptNotionType[]; related: NotionRelatedContent[] };
@@ -157,7 +156,6 @@ export const Article = ({
157
156
  messageBoxLinks,
158
157
  children,
159
158
  competenceGoals,
160
- competenceGoalsLoading,
161
159
  id,
162
160
  locale,
163
161
  notions,
@@ -214,7 +212,7 @@ export const Article = ({
214
212
  <MessageBox links={messageBoxLinks}>{messages.messageBox}</MessageBox>
215
213
  </MSGboxWrapper>
216
214
  )}
217
- <ArticleHeaderWrapper competenceGoals={competenceGoals} competenceGoalsLoading={competenceGoalsLoading}>
215
+ <ArticleHeaderWrapper competenceGoals={competenceGoals}>
218
216
  {heartButton ? <ArticleFavoritesButtonWrapper>{heartButton}</ArticleFavoritesButtonWrapper> : null}
219
217
 
220
218
  <ArticleTitle icon={icon} label={messages.label}>
@@ -6,38 +6,21 @@
6
6
  *
7
7
  */
8
8
 
9
- import React, { ComponentType, ReactNode, useEffect, useState } from 'react';
9
+ import React, { ReactNode, useEffect } from 'react';
10
10
  import BEMHelper from 'react-bem-helper';
11
- import { useTranslation } from 'react-i18next';
12
- import { ButtonV2 } from '@ndla/button';
13
11
  import { isMobile } from 'react-device-detect';
14
12
 
15
- import styled from '@emotion/styled';
16
- import { FooterHeaderIcon } from '@ndla/icons/common';
17
- import CompetenceGoalsDialog from '../CompetenceGoals/CompetenceGoalsDialog';
18
-
19
13
  const classes = new BEMHelper({
20
14
  name: 'article',
21
15
  prefix: 'c-',
22
16
  });
23
17
 
24
- const CompetenceBadgeText = styled.span`
25
- padding: 0 5px;
26
- `;
27
-
28
18
  type Props = {
29
- competenceGoals?: (inp: {
30
- Dialog: ComponentType;
31
- dialogProps: { isOpen: boolean; onClose: () => void; controlled: true };
32
- }) => ReactNode;
33
- competenceGoalsLoading?: boolean;
19
+ competenceGoals?: ReactNode;
34
20
  children: ReactNode;
35
21
  };
36
22
 
37
- const ArticleHeaderWrapper = ({ children, competenceGoals, competenceGoalsLoading }: Props) => {
38
- const [isOpen, setIsOpen] = useState(false);
39
- const { t } = useTranslation();
40
-
23
+ const ArticleHeaderWrapper = ({ children, competenceGoals }: Props) => {
41
24
  useEffect(() => {
42
25
  if (isMobile) {
43
26
  const heroContentList: NodeListOf<HTMLElement> = document.querySelectorAll('.c-article__header');
@@ -48,41 +31,10 @@ const ArticleHeaderWrapper = ({ children, competenceGoals, competenceGoalsLoadin
48
31
  }
49
32
  }, []);
50
33
 
51
- const openDialog = () => {
52
- setIsOpen(true);
53
- };
54
-
55
- const closeDialog = () => {
56
- setIsOpen(false);
57
- };
58
-
59
- if (!competenceGoals) {
60
- return <div {...classes('header')}>{children}</div>;
61
- }
62
-
63
- const dialog = competenceGoals({
64
- Dialog: CompetenceGoalsDialog,
65
- dialogProps: {
66
- isOpen: isOpen,
67
- onClose: closeDialog,
68
- controlled: true,
69
- },
70
- });
71
34
  return (
72
35
  <div {...classes('header')}>
73
36
  {children}
74
- <ButtonV2
75
- aria-busy={competenceGoalsLoading}
76
- size="xsmall"
77
- colorTheme="light"
78
- shape="pill"
79
- onClick={openDialog}
80
- disabled={competenceGoalsLoading}
81
- >
82
- <FooterHeaderIcon />
83
- <CompetenceBadgeText>{t('competenceGoals.showCompetenceGoals')}</CompetenceBadgeText>
84
- </ButtonV2>
85
- {dialog}
37
+ {competenceGoals}
86
38
  </div>
87
39
  );
88
40
  };
@@ -63,10 +63,6 @@
63
63
  width: 100vw;
64
64
  -webkit-overflow-scrolling: touch;
65
65
 
66
- .c-tabs {
67
- margin-left: 0;
68
- }
69
-
70
66
  @include mq(tablet) {
71
67
  width: 90%;
72
68
  max-height: 85vh;
@@ -10,26 +10,6 @@ import { ToggleItem } from '../Filter';
10
10
 
11
11
  const StyledWrapper = styled.nav`
12
12
  margin: 32px 0 0;
13
- .c-tabs--subjects {
14
- margin: 0;
15
- }
16
- .c-tabs__list--subjects {
17
- margin: 0;
18
- }
19
- .c-tabs__tab--subjects {
20
- ${mq.range({ until: breakpoints.tablet })} {
21
- margin: 0;
22
- font-size: 12px;
23
- padding-left: 8px;
24
- padding-right: 8px;
25
- :first-of-type {
26
- padding-left: 0;
27
- }
28
- :last-of-type {
29
- padding-right: 0;
30
- }
31
- }
32
- }
33
13
  `;
34
14
 
35
15
  const StyledList = styled.ul`
@@ -213,6 +193,7 @@ const FrontpageAllSubjects = ({
213
193
  category.visible &&
214
194
  data.push({
215
195
  title: t(`subjectCategories.${category.type}`),
196
+ id: category.type,
216
197
  content: (
217
198
  <>
218
199
  {category.message && (
@@ -228,12 +209,13 @@ const FrontpageAllSubjects = ({
228
209
 
229
210
  data.push({
230
211
  title: t('frontpageMenu.allsubjects'),
212
+ id: 'allsubjects',
231
213
  content: renderList(allSubjects, onNavigate, onToggleSubject, subjectViewType, selectedSubjects),
232
214
  });
233
215
 
234
216
  return (
235
217
  <StyledWrapper>
236
- <Tabs modifier="subjects" tabs={data} />
218
+ <Tabs tabs={data} />
237
219
  </StyledWrapper>
238
220
  );
239
221
  };
@@ -8,9 +8,10 @@
8
8
 
9
9
  import React from 'react';
10
10
  import styled from '@emotion/styled';
11
- import { fonts, spacing, spacingUnit, breakpoints, mq, colors } from '@ndla/core';
11
+ import { spacing, spacingUnit, breakpoints, mq, colors } from '@ndla/core';
12
12
  import { getLicenseByAbbreviation } from '@ndla/licenses';
13
13
  import { LicenseByline } from '@ndla/notion';
14
+ import { Heading } from '../Typography';
14
15
 
15
16
  type StyledWrapperProps = {
16
17
  invertedStyle?: boolean;
@@ -18,15 +19,6 @@ type StyledWrapperProps = {
18
19
 
19
20
  const StyledWrapper = styled.div<StyledWrapperProps>`
20
21
  background: transparent;
21
- font-family: ${fonts.serif};
22
- h1,
23
- h2,
24
- h3,
25
- h4,
26
- h5,
27
- h6 {
28
- font-family: ${fonts.serif};
29
- }
30
22
  max-width: 720px;
31
23
  margin: ${spacingUnit * 0.75}px ${spacing.normal} ${spacing.xsmall} 0 !important;
32
24
  ${mq.range({ from: breakpoints.desktop })} {
@@ -59,7 +51,7 @@ const LicenseWrapper = styled.div`
59
51
  }
60
52
  `;
61
53
 
62
- const StyledHeader = styled.h1`
54
+ const StyledHeader = styled(Heading)`
63
55
  margin-bottom: ${spacing.small};
64
56
  `;
65
57
 
@@ -79,7 +71,9 @@ export const LearningPathInformation = ({ description, title, license, invertedS
79
71
  <section className="o-wrapper">
80
72
  <StyledWrapper invertedStyle={invertedStyle} className="c-article">
81
73
  <LicenseWrapper>
82
- <StyledHeader id={id}>{title}</StyledHeader>
74
+ <StyledHeader element="h1" headingStyle="h1" tabIndex={-1} id={id}>
75
+ {title}
76
+ </StyledHeader>
83
77
  <LicenseByline licenseRights={rights} color={colors.brand.tertiary} />
84
78
  </LicenseWrapper>
85
79
  {description && <div dangerouslySetInnerHTML={{ __html: description }} />}
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
 
9
- import React, { ReactChild, ReactChildren, ReactNode } from 'react';
9
+ import React, { ReactNode } from 'react';
10
10
  import { spacing, mq, breakpoints, colors } from '@ndla/core';
11
11
  import { ModalHeader, ModalBody, ModalCloseButton, Modal } from '@ndla/modal';
12
12
  import { css } from '@emotion/react';
@@ -36,7 +36,7 @@ const StyledModal = styled(Modal)`
36
36
 
37
37
  type ModalWrapperProps = {
38
38
  innerWidth: number;
39
- children: (arg: VoidFunction) => ReactChild | ReactChildren | ReactNode;
39
+ children: (arg: VoidFunction) => ReactNode;
40
40
  };
41
41
 
42
42
  const ModalWrapperComponent = ({ innerWidth, children }: ModalWrapperProps) => {
@@ -1,4 +1,4 @@
1
- import React, { ReactChild, ReactChildren, ReactNode, useState } from 'react';
1
+ import React, { ReactNode, useState } from 'react';
2
2
  import { Drawer } from '@ndla/modal';
3
3
  import { IconButtonV2 as IconButton } from '@ndla/button';
4
4
  import { Cross } from '@ndla/icons/action';
@@ -9,7 +9,7 @@ import ToggleSearchButton from '../Search/ToggleSearchButton';
9
9
 
10
10
  interface Props {
11
11
  onClose: VoidFunction;
12
- children: (arg: () => void) => ReactChild | ReactChildren | ReactNode;
12
+ children: (arg: () => void) => ReactNode;
13
13
  hideOnNarrowScreen?: boolean;
14
14
  ndlaFilm?: boolean;
15
15
  }
@@ -1,11 +1,12 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import styled from '@emotion/styled';
4
- import { breakpoints, fonts, mq } from '@ndla/core';
4
+ import { breakpoints, mq } from '@ndla/core';
5
5
  import LayoutItem, { OneColumn } from '../Layout';
6
6
  import List from './List';
7
7
  import { ListItemProps } from './ListItem';
8
8
  import { HomeBreadcrumb, SimpleBreadcrumbItem } from '../Breadcrumb';
9
+ import { Heading } from '../Typography';
9
10
 
10
11
  const StyledWrapper = styled.div`
11
12
  display: flex;
@@ -30,23 +31,6 @@ const Header = styled.div`
30
31
  margin-top: 32px;
31
32
  `;
32
33
 
33
- const Heading = styled.h1`
34
- margin: 10px 0 10px 0;
35
- font-size: 20px;
36
- line-height: 25px;
37
- font-weight: ${fonts.weight.bold};
38
-
39
- ${mq.range({ from: breakpoints.mobileWide })} {
40
- margin: 40px 0 22px;
41
- ${fonts.sizes('40px', '48px')};
42
- }
43
-
44
- ${mq.range({ from: breakpoints.desktop })} {
45
- margin: 50px 0 24px;
46
- ${fonts.sizes('52px', '65px')};
47
- }
48
- `;
49
-
50
34
  const InfoText = styled.div`
51
35
  max-width: 720px;
52
36
  font-size: 16px;
@@ -107,7 +91,7 @@ export const MultidisciplinarySubject = ({
107
91
  <Header>
108
92
  <LayoutItem layout="extend">
109
93
  <HomeBreadcrumb items={breadcrumbs} />
110
- <Heading id={id} tabIndex={-1}>
94
+ <Heading element="h1" headingStyle="h1" id={id} tabIndex={-1}>
111
95
  {t('frontpageMultidisciplinarySubject.heading')}
112
96
  </Heading>
113
97
  <InfoText>{t('frontpageMultidisciplinarySubject.text')}</InfoText>
@@ -7,7 +7,6 @@
7
7
  */
8
8
 
9
9
  import NavigationBox from './NavigationBox';
10
- import NavigationHeading from './NavigationHeading';
11
10
  import NavigationTopicAbout from './NavigationTopicAbout';
12
11
 
13
- export { NavigationHeading, NavigationBox, NavigationTopicAbout };
12
+ export { NavigationBox, NavigationTopicAbout };
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
5
5
  import LayoutItem, { OneColumn } from '../Layout';
6
6
  import ProgrammeSubjects, { GradesProps } from './ProgrammeSubjects';
7
7
  import MessageBox from '../Messages/MessageBox';
8
- import { NavigationHeading } from '..';
8
+ import { Heading } from '..';
9
9
  const StyledWrapper = styled.div`
10
10
  display: flex;
11
11
  flex-direction: column;
@@ -76,7 +76,9 @@ export const Programme = ({ heading, image, grades, selectedGrade, messageBoxTex
76
76
  <StyledLayoutWrapper>
77
77
  <LayoutItem layout="extend">
78
78
  <StyledContentWrapper>
79
- <NavigationHeading headingId={headingId}>{heading}</NavigationHeading>
79
+ <Heading element="h1" margin="xlarge" headingStyle="h1" serif id={headingId} tabIndex={-1}>
80
+ {heading}
81
+ </Heading>
80
82
  {messageBoxText && <MessageBox>{t(messageBoxText)}</MessageBox>}
81
83
  <SubjectsWrapper>
82
84
  <ProgrammeSubjects grades={grades} selectedGrade={selectedGrade} />
@@ -40,14 +40,6 @@
40
40
  }
41
41
  }
42
42
 
43
- .c-tabs {
44
- display: none;
45
-
46
- @include mq(desktop) {
47
- display: block;
48
- }
49
- }
50
-
51
43
  .c-search-filter {
52
44
  display: none;
53
45
 
@@ -12,18 +12,7 @@ import { breakpoints, fonts, mq } from '@ndla/core';
12
12
  import { useTranslation } from 'react-i18next';
13
13
  import { ItemProps } from '../Navigation/NavigationBox';
14
14
  import { NavigationBox } from '../Navigation';
15
-
16
- const Heading = styled.h1`
17
- ${fonts.sizes('30px', '35px')};
18
-
19
- ${mq.range({ from: breakpoints.tablet })} {
20
- ${fonts.sizes('36px', '46px')};
21
- }
22
-
23
- ${mq.range({ from: breakpoints.desktop })} {
24
- ${fonts.sizes('52px', '65px')};
25
- }
26
- `;
15
+ import { Heading } from '../Typography';
27
16
 
28
17
  const Introduction = styled.p`
29
18
  max-width: 800px;
@@ -51,7 +40,7 @@ const ToolboxInfo = ({ title, introduction, topics, onSelectTopic, id }: Props)
51
40
  const { t } = useTranslation();
52
41
  return (
53
42
  <>
54
- <Heading id={id} tabIndex={-1}>
43
+ <Heading element="h1" headingStyle="h1" id={id} tabIndex={-1}>
55
44
  {title}
56
45
  </Heading>
57
46
  <Introduction>{introduction}</Introduction>
@@ -22,6 +22,7 @@ import { ItemProps } from '../Navigation/NavigationBox';
22
22
  import { NavigationBox } from '../Navigation';
23
23
  import { makeSrcQueryString, ImageCrop, ImageFocalPoint } from '../Image';
24
24
  import { MessageBox } from '../Messages';
25
+ import { Heading } from '../Typography';
25
26
 
26
27
  type InvertItProps = {
27
28
  invertedStyle?: boolean;
@@ -257,9 +258,9 @@ const Topic = ({
257
258
  <TopicIntroductionWrapper>
258
259
  <div>
259
260
  <HeadingWrapper>
260
- <h1 id={id} tabIndex={-1}>
261
+ <Heading element="h1" headingStyle="h2" id={id} tabIndex={-1}>
261
262
  {topic.title}
262
- </h1>
263
+ </Heading>
263
264
  {isAdditionalTopic && (
264
265
  <>
265
266
  <AdditionalIcon aria-hidden="true">T</AdditionalIcon>
@@ -1,3 +1,2 @@
1
1
  export { default as Translation } from './Translation';
2
- export { default as TranslationBox } from './TranslationBox';
3
2
  export { default as TranslationLine } from './TranslationLine';
package/src/all.scss CHANGED
@@ -1,6 +1,5 @@
1
1
  @import '~@ndla/core/scss/core';
2
2
  @import '~@ndla/icons/scss/icons';
3
3
  @import './main';
4
- @import '~@ndla/tabs/scss/tabs';
5
4
  @import '~@ndla/core/scss/utilities';
6
5
  @import '~@ndla/video-search/scss/video-search';
package/src/index.ts CHANGED
@@ -38,8 +38,6 @@ export {
38
38
  default as Article,
39
39
  } from './Article';
40
40
 
41
- export { CompetenceGoalsDialog } from './CompetenceGoals';
42
-
43
41
  export { default as Table } from './Table';
44
42
 
45
43
  export { default as ResourcesWrapper, ResourcesTopicTitle } from './ResourcesWrapper';
@@ -124,7 +122,7 @@ export {
124
122
  LearningPathMobileStepInfo,
125
123
  LearningPathMobileHeader,
126
124
  } from './LearningPaths';
127
- export { Translation, TranslationLine, TranslationBox } from './Translation';
125
+ export { Translation, TranslationLine } from './Translation';
128
126
 
129
127
  export { default as SearchResultSleeve } from './Search/SearchResultSleeve';
130
128
 
@@ -156,7 +154,7 @@ export { ResourceBox } from './ResourceBox';
156
154
 
157
155
  export { default as AudioPlayer, initAudioPlayers } from './AudioPlayer';
158
156
 
159
- export { NavigationHeading, NavigationBox, NavigationTopicAbout } from './Navigation';
157
+ export { NavigationBox, NavigationTopicAbout } from './Navigation';
160
158
 
161
159
  export { default as Programme } from './Programme';
162
160
 
package/src/main.scss CHANGED
@@ -20,6 +20,5 @@
20
20
  @import 'Table/component.tables';
21
21
  @import 'Filter/component.filter';
22
22
  @import 'Translation/component.translation';
23
- @import 'Translation/component.translation-box';
24
23
  @import 'Search/component.search';
25
24
  @import 'Carousel/component.carousel';