@ndla/ui 25.1.0 → 25.2.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 (82) hide show
  1. package/es/Article/ArticleFavoritesButton.js +2 -1
  2. package/es/Frontpage/FrontpageHeader.js +7 -5
  3. package/es/Frontpage/FrontpageProgramMenu.js +12 -10
  4. package/es/Image/Image.js +5 -4
  5. package/es/LanguageSelector/LanguageSelector.js +31 -26
  6. package/es/Masthead/Masthead.js +8 -8
  7. package/es/Masthead/MastheadAuthModal.js +11 -11
  8. package/es/Masthead/MastheadSearchModal.js +9 -11
  9. package/es/NDLAFilm/AboutNdlaFilm.js +3 -3
  10. package/es/Navigation/NavigationHeading.js +9 -6
  11. package/es/Navigation/NavigationTopicAbout.js +15 -14
  12. package/es/Programme/Programme.js +10 -7
  13. package/es/Search/SearchField.js +4 -3
  14. package/es/Search/SearchFieldForm.js +4 -3
  15. package/es/Search/ToggleSearchButton.js +3 -3
  16. package/es/TagSelector/SuggestionInput.js +8 -8
  17. package/es/Topic/Topic.js +21 -20
  18. package/es/TopicMenu/TopicMenu.js +22 -13
  19. package/es/TopicMenu/TopicMenuButton.js +5 -5
  20. package/es/all.css +1 -1
  21. package/es/locale/messages-nb.js +2 -2
  22. package/es/locale/messages-nn.js +2 -2
  23. package/es/locale/messages-se.js +2 -2
  24. package/es/locale/messages-sma.js +2 -2
  25. package/lib/Article/ArticleFavoritesButton.js +2 -1
  26. package/lib/Frontpage/FrontpageHeader.js +7 -5
  27. package/lib/Frontpage/FrontpageProgramMenu.js +12 -10
  28. package/lib/Image/Image.d.ts +1 -1
  29. package/lib/Image/Image.js +5 -4
  30. package/lib/LanguageSelector/LanguageSelector.d.ts +1 -1
  31. package/lib/LanguageSelector/LanguageSelector.js +31 -26
  32. package/lib/Masthead/Masthead.js +8 -8
  33. package/lib/Masthead/MastheadAuthModal.js +11 -11
  34. package/lib/Masthead/MastheadSearchModal.js +9 -11
  35. package/lib/NDLAFilm/AboutNdlaFilm.js +4 -4
  36. package/lib/Navigation/NavigationHeading.d.ts +2 -1
  37. package/lib/Navigation/NavigationHeading.js +9 -6
  38. package/lib/Navigation/NavigationTopicAbout.js +15 -14
  39. package/lib/Programme/Programme.d.ts +2 -1
  40. package/lib/Programme/Programme.js +10 -7
  41. package/lib/Search/SearchField.js +4 -3
  42. package/lib/Search/SearchFieldForm.js +4 -3
  43. package/lib/Search/ToggleSearchButton.js +3 -3
  44. package/lib/TagSelector/SuggestionInput.js +8 -8
  45. package/lib/Topic/Topic.js +21 -20
  46. package/lib/TopicMenu/TopicMenu.js +47 -39
  47. package/lib/TopicMenu/TopicMenuButton.js +6 -6
  48. package/lib/all.css +1 -1
  49. package/lib/locale/messages-nb.js +2 -2
  50. package/lib/locale/messages-nn.js +2 -2
  51. package/lib/locale/messages-se.js +2 -2
  52. package/lib/locale/messages-sma.js +2 -2
  53. package/package.json +11 -11
  54. package/src/Article/ArticleFavoritesButton.tsx +2 -1
  55. package/src/Frontpage/FrontpageHeader.tsx +1 -1
  56. package/src/Frontpage/FrontpageProgramMenu.tsx +1 -1
  57. package/src/Image/Image.tsx +1 -1
  58. package/src/LanguageSelector/LanguageSelector.tsx +21 -23
  59. package/src/Masthead/Masthead.tsx +2 -0
  60. package/src/Masthead/MastheadAuthModal.tsx +16 -16
  61. package/src/Masthead/MastheadSearchModal.tsx +6 -23
  62. package/src/NDLAFilm/AboutNdlaFilm.tsx +2 -2
  63. package/src/Navigation/NavigationHeading.tsx +3 -2
  64. package/src/Navigation/NavigationTopicAbout.tsx +1 -0
  65. package/src/Programme/Programme.tsx +11 -2
  66. package/src/Search/SearchField.tsx +6 -1
  67. package/src/Search/SearchFieldForm.tsx +1 -1
  68. package/src/Search/ToggleSearchButton.tsx +2 -2
  69. package/src/TagSelector/SuggestionInput.tsx +1 -1
  70. package/src/Topic/Topic.tsx +1 -0
  71. package/src/TopicMenu/TopicMenu.jsx +23 -17
  72. package/src/TopicMenu/TopicMenuButton.jsx +6 -7
  73. package/src/locale/messages-nb.ts +1 -1
  74. package/src/locale/messages-nn.ts +1 -1
  75. package/src/locale/messages-se.ts +1 -1
  76. package/src/locale/messages-sma.ts +1 -1
  77. package/src/main.scss +0 -1
  78. package/es/Article/ArticleAuthorContent.js +0 -71
  79. package/lib/Article/ArticleAuthorContent.d.ts +0 -28
  80. package/lib/Article/ArticleAuthorContent.js +0 -88
  81. package/src/Article/ArticleAuthorContent.tsx +0 -107
  82. package/src/Article/component.article-author-popup.scss +0 -90
@@ -1040,7 +1040,7 @@ const messages = {
1040
1040
  loginWelcome: 'Velkommen til NDLA! Her kan du organisere fagstoffet på <i>din</i> måte!',
1041
1041
  welcome:
1042
1042
  'Velkommen til Min NDLA! Nå kan du lagre dine favorittressurser fra NDLA og organisere dem slik du ønsker i mapper og med emneknagger.',
1043
- read: { our: 'Les våre', ours: 'Les vår' },
1043
+ read: { our: 'Les vår', ours: 'Les våre' },
1044
1044
  privacy: 'personvernerklæring her',
1045
1045
  questions: { question: 'Lurer du på noe?', ask: 'Spør oss i chatten' },
1046
1046
  wishToDelete: 'Vil du ikke ha brukerprofil hos oss lenger?',
package/src/main.scss CHANGED
@@ -4,7 +4,6 @@
4
4
  @import 'Logo/component.logo';
5
5
  @import 'Hero/component.hero';
6
6
  @import 'Article/component.article';
7
- @import 'Article/component.article-author-popup';
8
7
 
9
8
  @import 'global/components/component.bodybox';
10
9
  @import 'global/components/component.story-intro';
@@ -1,71 +0,0 @@
1
- /**
2
- * Copyright (c) 2016-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
- import React from 'react';
9
- import BEMHelper from 'react-bem-helper';
10
- import { useTranslation } from 'react-i18next';
11
- import Button from '@ndla/button';
12
- import SafeLink from '@ndla/safelink';
13
- import Portrait from '../Portrait';
14
- import { jsx as ___EmotionJSX } from "@emotion/core";
15
- var classes = new BEMHelper({
16
- name: 'article-author-popup',
17
- prefix: 'c-'
18
- });
19
-
20
- var ArticleAuthorContent = function ArticleAuthorContent(_ref) {
21
- var showAuthor = _ref.showAuthor,
22
- authors = _ref.authors,
23
- onSelectAuthor = _ref.onSelectAuthor;
24
-
25
- var _useTranslation = useTranslation(),
26
- t = _useTranslation.t;
27
-
28
- if ((showAuthor === null || showAuthor === undefined) && authors.length !== 1) {
29
- // Render author list
30
- return ___EmotionJSX("div", null, ___EmotionJSX("h1", null, t('article.multipleAuthorsLabel')), ___EmotionJSX("hr", null), ___EmotionJSX("ul", classes('ul-list'), authors.map(function (author, index) {
31
- return ___EmotionJSX("li", {
32
- key: author.name
33
- }, author.role && ___EmotionJSX("span", null, author.role, ":"), ___EmotionJSX("span", null, author.phone || author.email || author.introduction || author.title ? ___EmotionJSX(Button, {
34
- type: "button",
35
- appearance: "link",
36
- onClick: function onClick() {
37
- onSelectAuthor(index);
38
- }
39
- }, author.name) : author.name), author.licenses && ___EmotionJSX("span", classes('', 'author-licenses'), author.licenses));
40
- })));
41
- } // Show author
42
-
43
-
44
- var _authors = authors[showAuthor !== null && showAuthor !== undefined ? showAuthor : 0],
45
- image = _authors.image,
46
- name = _authors.name,
47
- shortName = _authors.shortName,
48
- title = _authors.title,
49
- role = _authors.role,
50
- phone = _authors.phone,
51
- email = _authors.email,
52
- introduction = _authors.introduction,
53
- urlContributions = _authors.urlContributions,
54
- urlAuthor = _authors.urlAuthor;
55
- return ___EmotionJSX("div", classes(), ___EmotionJSX("div", classes('author-info'), image && ___EmotionJSX(Portrait, {
56
- src: image,
57
- alt: name
58
- }), ___EmotionJSX("section", null, ___EmotionJSX("h1", null, name), ___EmotionJSX("hr", null), ___EmotionJSX("ul", null, title && ___EmotionJSX("li", null, "".concat(title).concat(title ? ' / ' : '').concat(role)), phone && ___EmotionJSX("li", null, phone), email && ___EmotionJSX("li", null, ___EmotionJSX(SafeLink, {
59
- to: "mailto:".concat(email)
60
- }, email))), introduction && ___EmotionJSX("p", null, introduction), ___EmotionJSX("div", classes('link-container'), urlContributions && ___EmotionJSX(SafeLink, {
61
- to: urlContributions
62
- }, t('article.urlContributionsLabel', {
63
- name: shortName
64
- })), urlAuthor && ___EmotionJSX(SafeLink, {
65
- to: urlAuthor
66
- }, t('article.urlAuthorLabel', {
67
- name: shortName
68
- }))))));
69
- };
70
-
71
- export default ArticleAuthorContent;
@@ -1,28 +0,0 @@
1
- /**
2
- * Copyright (c) 2016-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
- /// <reference types="react" />
9
- declare type Author = {
10
- image: string;
11
- name: string;
12
- shortName: string;
13
- role: string;
14
- phone: string;
15
- email: string;
16
- introduction: string;
17
- urlContributions: string;
18
- urlAuthor: string;
19
- title: string;
20
- licenses: string[];
21
- };
22
- declare type Props = {
23
- showAuthor: any;
24
- authors: Array<Author>;
25
- onSelectAuthor: (index: number) => void;
26
- };
27
- declare const ArticleAuthorContent: ({ showAuthor, authors, onSelectAuthor }: Props) => JSX.Element;
28
- export default ArticleAuthorContent;
@@ -1,88 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
11
-
12
- var _reactI18next = require("react-i18next");
13
-
14
- var _button = _interopRequireDefault(require("@ndla/button"));
15
-
16
- var _safelink = _interopRequireDefault(require("@ndla/safelink"));
17
-
18
- var _Portrait = _interopRequireDefault(require("../Portrait"));
19
-
20
- var _core = require("@emotion/core");
21
-
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
-
24
- /**
25
- * Copyright (c) 2016-present, NDLA.
26
- *
27
- * This source code is licensed under the GPLv3 license found in the
28
- * LICENSE file in the root directory of this source tree.
29
- *
30
- */
31
- var classes = new _reactBemHelper["default"]({
32
- name: 'article-author-popup',
33
- prefix: 'c-'
34
- });
35
-
36
- var ArticleAuthorContent = function ArticleAuthorContent(_ref) {
37
- var showAuthor = _ref.showAuthor,
38
- authors = _ref.authors,
39
- onSelectAuthor = _ref.onSelectAuthor;
40
-
41
- var _useTranslation = (0, _reactI18next.useTranslation)(),
42
- t = _useTranslation.t;
43
-
44
- if ((showAuthor === null || showAuthor === undefined) && authors.length !== 1) {
45
- // Render author list
46
- return (0, _core.jsx)("div", null, (0, _core.jsx)("h1", null, t('article.multipleAuthorsLabel')), (0, _core.jsx)("hr", null), (0, _core.jsx)("ul", classes('ul-list'), authors.map(function (author, index) {
47
- return (0, _core.jsx)("li", {
48
- key: author.name
49
- }, author.role && (0, _core.jsx)("span", null, author.role, ":"), (0, _core.jsx)("span", null, author.phone || author.email || author.introduction || author.title ? (0, _core.jsx)(_button["default"], {
50
- type: "button",
51
- appearance: "link",
52
- onClick: function onClick() {
53
- onSelectAuthor(index);
54
- }
55
- }, author.name) : author.name), author.licenses && (0, _core.jsx)("span", classes('', 'author-licenses'), author.licenses));
56
- })));
57
- } // Show author
58
-
59
-
60
- var _authors = authors[showAuthor !== null && showAuthor !== undefined ? showAuthor : 0],
61
- image = _authors.image,
62
- name = _authors.name,
63
- shortName = _authors.shortName,
64
- title = _authors.title,
65
- role = _authors.role,
66
- phone = _authors.phone,
67
- email = _authors.email,
68
- introduction = _authors.introduction,
69
- urlContributions = _authors.urlContributions,
70
- urlAuthor = _authors.urlAuthor;
71
- return (0, _core.jsx)("div", classes(), (0, _core.jsx)("div", classes('author-info'), image && (0, _core.jsx)(_Portrait["default"], {
72
- src: image,
73
- alt: name
74
- }), (0, _core.jsx)("section", null, (0, _core.jsx)("h1", null, name), (0, _core.jsx)("hr", null), (0, _core.jsx)("ul", null, title && (0, _core.jsx)("li", null, "".concat(title).concat(title ? ' / ' : '').concat(role)), phone && (0, _core.jsx)("li", null, phone), email && (0, _core.jsx)("li", null, (0, _core.jsx)(_safelink["default"], {
75
- to: "mailto:".concat(email)
76
- }, email))), introduction && (0, _core.jsx)("p", null, introduction), (0, _core.jsx)("div", classes('link-container'), urlContributions && (0, _core.jsx)(_safelink["default"], {
77
- to: urlContributions
78
- }, t('article.urlContributionsLabel', {
79
- name: shortName
80
- })), urlAuthor && (0, _core.jsx)(_safelink["default"], {
81
- to: urlAuthor
82
- }, t('article.urlAuthorLabel', {
83
- name: shortName
84
- }))))));
85
- };
86
-
87
- var _default = ArticleAuthorContent;
88
- exports["default"] = _default;
@@ -1,107 +0,0 @@
1
- /**
2
- * Copyright (c) 2016-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import React from 'react';
10
- import BEMHelper from 'react-bem-helper';
11
- import { useTranslation } from 'react-i18next';
12
- import Button from '@ndla/button';
13
- import SafeLink from '@ndla/safelink';
14
- import Portrait from '../Portrait';
15
-
16
- const classes = new BEMHelper({
17
- name: 'article-author-popup',
18
- prefix: 'c-',
19
- });
20
-
21
- type Author = {
22
- image: string;
23
- name: string;
24
- shortName: string;
25
- role: string;
26
- phone: string;
27
- email: string;
28
- introduction: string;
29
- urlContributions: string;
30
- urlAuthor: string;
31
- title: string;
32
- licenses: string[];
33
- };
34
-
35
- type Props = {
36
- showAuthor: any;
37
- authors: Array<Author>;
38
- onSelectAuthor: (index: number) => void;
39
- };
40
-
41
- const ArticleAuthorContent = ({ showAuthor, authors, onSelectAuthor }: Props) => {
42
- const { t } = useTranslation();
43
- if ((showAuthor === null || showAuthor === undefined) && authors.length !== 1) {
44
- // Render author list
45
- return (
46
- <div>
47
- <h1>{t('article.multipleAuthorsLabel')}</h1>
48
- <hr />
49
- <ul {...classes('ul-list')}>
50
- {authors.map((author, index) => (
51
- <li key={author.name}>
52
- {author.role && <span>{author.role}:</span>}
53
- <span>
54
- {author.phone || author.email || author.introduction || author.title ? (
55
- <Button
56
- type="button"
57
- appearance="link"
58
- onClick={() => {
59
- onSelectAuthor(index);
60
- }}>
61
- {author.name}
62
- </Button>
63
- ) : (
64
- author.name
65
- )}
66
- </span>
67
- {author.licenses && <span {...classes('', 'author-licenses')}>{author.licenses}</span>}
68
- </li>
69
- ))}
70
- </ul>
71
- </div>
72
- );
73
- }
74
- // Show author
75
- const { image, name, shortName, title, role, phone, email, introduction, urlContributions, urlAuthor } =
76
- authors[showAuthor !== null && showAuthor !== undefined ? showAuthor : 0];
77
-
78
- return (
79
- <div {...classes()}>
80
- <div {...classes('author-info')}>
81
- {image && <Portrait src={image} alt={name} />}
82
- <section>
83
- <h1>{name}</h1>
84
- <hr />
85
- <ul>
86
- {title && <li>{`${title}${title ? ' / ' : ''}${role}`}</li>}
87
- {phone && <li>{phone}</li>}
88
- {email && (
89
- <li>
90
- <SafeLink to={`mailto:${email}`}>{email}</SafeLink>
91
- </li>
92
- )}
93
- </ul>
94
- {introduction && <p>{introduction}</p>}
95
- <div {...classes('link-container')}>
96
- {urlContributions && (
97
- <SafeLink to={urlContributions}>{t('article.urlContributionsLabel', { name: shortName })}</SafeLink>
98
- )}
99
- {urlAuthor && <SafeLink to={urlAuthor}>{t('article.urlAuthorLabel', { name: shortName })}</SafeLink>}
100
- </div>
101
- </section>
102
- </div>
103
- </div>
104
- );
105
- };
106
-
107
- export default ArticleAuthorContent;
@@ -1,90 +0,0 @@
1
- /**
2
- ** ARTICLE AUTHOR POPUP
3
- **
4
- ** EXAMPLE:
5
- ** <div class="c-article-author-popup">
6
- ** <span class="c-article-author-popup__authors"><svg /> [Opphavsperson].</span>
7
- ** <span class="c-article-author-popup__date"><svg /> Publisert [dato]</span>
8
- ** </div>
9
- **/
10
-
11
- .c-article-author-popup {
12
-
13
- &__ul-list {
14
- @include font-size(18px, 20px);
15
- list-style-type: none;
16
- list-style-image: none;
17
- margin: $spacing--small 0;
18
- padding: 0;
19
- li {
20
- margin: 0;
21
- padding: $spacing--small / 2 0;
22
- span:not(:first-child) {
23
- padding-left: $spacing--small / 2;
24
- }
25
- }
26
- button {
27
- font-size: inherit;
28
- line-height: inherit;
29
- }
30
- @include mq($until: tablet) {
31
- &:not(--large) {
32
- li {
33
- line-height: $spacing;
34
- padding-bottom: $spacing;
35
- span {
36
- &:first-child {
37
- display: block;
38
- }
39
- }
40
- }
41
- }
42
- }
43
- }
44
-
45
- &--author-licenses {
46
- @include font-size(14px, 20px);
47
- color: $brand-grey-dark;
48
- }
49
-
50
- ul {
51
- margin: $spacing--small 0;
52
- padding: 0;
53
- list-style: none;
54
- li {
55
- margin: 0;
56
- padding: 0;
57
- }
58
- }
59
-
60
- &__link-container {
61
- margin-top: $spacing;
62
- display: flex;
63
- flex-flow: column;
64
- align-items: flex-start;
65
- > a:not(:first-child) {
66
- margin-top: $spacing--small;
67
- }
68
- }
69
-
70
- &__author-info {
71
- display: flex;
72
- margin-bottom: $spacing;
73
- animation-name: fadeIn;
74
- animation-duration: 0.5s;
75
-
76
- > :nth-child(2) {
77
- flex-grow: 1;
78
- padding-left: $spacing;
79
- }
80
-
81
- @include mq($until: mobileWide) {
82
- display: block;
83
- margin-bottom: 2rem;
84
- > :nth-child(2) {
85
- padding-top: $spacing;
86
- padding-left: 0;
87
- }
88
- }
89
- }
90
- }