@ndla/ui 48.0.0 → 49.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 (161) hide show
  1. package/es/BlogPost/BlogPost.js +6 -6
  2. package/es/CampaignBlock/CampaignBlock.js +8 -8
  3. package/es/CopyParagraphButton/CopyParagraphButton.js +30 -58
  4. package/es/CopyParagraphButton/index.js +1 -3
  5. package/es/Embed/RelatedContentEmbed.js +3 -3
  6. package/es/FactBox/FactBox.js +64 -19
  7. package/es/FactBox/index.js +0 -1
  8. package/es/Figure/index.js +0 -2
  9. package/es/FileList/File.js +46 -24
  10. package/es/FileList/FileList.js +18 -14
  11. package/es/FileList/index.js +0 -2
  12. package/es/LinkBlock/LinkBlock.js +7 -7
  13. package/es/Messages/index.js +1 -2
  14. package/es/Navigation/index.js +1 -2
  15. package/es/RelatedArticleList/RelatedArticleList.js +80 -35
  16. package/es/RelatedArticleList/index.js +2 -3
  17. package/es/Search/index.js +0 -1
  18. package/es/all.css +1 -1
  19. package/es/i18n/i18n.js +2 -1
  20. package/es/index.js +9 -11
  21. package/es/utils/relativeUrl.js +17 -2
  22. package/lib/BlogPost/BlogPost.js +5 -5
  23. package/lib/CampaignBlock/CampaignBlock.js +7 -7
  24. package/lib/CopyParagraphButton/CopyParagraphButton.d.ts +5 -4
  25. package/lib/CopyParagraphButton/CopyParagraphButton.js +29 -57
  26. package/lib/CopyParagraphButton/index.d.ts +1 -3
  27. package/lib/CopyParagraphButton/index.js +0 -14
  28. package/lib/Embed/RelatedContentEmbed.js +3 -3
  29. package/lib/FactBox/FactBox.d.ts +1 -4
  30. package/lib/FactBox/FactBox.js +72 -27
  31. package/lib/FactBox/index.d.ts +0 -1
  32. package/lib/FactBox/index.js +0 -7
  33. package/lib/Figure/index.d.ts +0 -2
  34. package/lib/Figure/index.js +0 -14
  35. package/lib/FileList/File.d.ts +22 -3
  36. package/lib/FileList/File.js +45 -25
  37. package/lib/FileList/FileList.d.ts +10 -14
  38. package/lib/FileList/FileList.js +17 -15
  39. package/lib/FileList/index.d.ts +0 -2
  40. package/lib/FileList/index.js +0 -14
  41. package/lib/LinkBlock/LinkBlock.js +6 -6
  42. package/lib/Messages/index.d.ts +1 -2
  43. package/lib/Messages/index.js +0 -7
  44. package/lib/Navigation/index.d.ts +1 -2
  45. package/lib/Navigation/index.js +0 -7
  46. package/lib/RelatedArticleList/RelatedArticleList.d.ts +16 -17
  47. package/lib/RelatedArticleList/RelatedArticleList.js +78 -35
  48. package/lib/RelatedArticleList/index.d.ts +2 -3
  49. package/lib/RelatedArticleList/index.js +2 -12
  50. package/lib/Search/index.d.ts +0 -1
  51. package/lib/Search/index.js +0 -7
  52. package/lib/all.css +1 -1
  53. package/lib/i18n/i18n.d.ts +1 -0
  54. package/lib/i18n/i18n.js +4 -2
  55. package/lib/index.d.ts +9 -11
  56. package/lib/index.js +9 -89
  57. package/lib/utils/relativeUrl.d.ts +1 -1
  58. package/lib/utils/relativeUrl.js +19 -4
  59. package/package.json +8 -8
  60. package/src/BlogPost/BlogPost.tsx +2 -2
  61. package/src/CampaignBlock/CampaignBlock.tsx +2 -2
  62. package/src/CopyParagraphButton/CopyParagraphButton.tsx +24 -46
  63. package/src/CopyParagraphButton/index.tsx +1 -3
  64. package/src/Embed/RelatedContentEmbed.stories.tsx +9 -9
  65. package/src/Embed/RelatedContentEmbed.tsx +3 -3
  66. package/src/FactBox/FactBox.tsx +29 -16
  67. package/src/FactBox/Factbox.stories.tsx +4 -4
  68. package/src/FactBox/index.ts +0 -2
  69. package/src/Figure/index.ts +0 -2
  70. package/src/FileList/File.tsx +62 -32
  71. package/src/FileList/FileList.stories.tsx +15 -15
  72. package/src/FileList/FileList.tsx +21 -27
  73. package/src/FileList/index.ts +0 -2
  74. package/src/LinkBlock/LinkBlock.tsx +2 -2
  75. package/src/Messages/index.ts +1 -2
  76. package/src/Navigation/index.ts +1 -2
  77. package/src/RelatedArticleList/RelatedArticleList.tsx +53 -47
  78. package/src/RelatedArticleList/index.ts +2 -3
  79. package/src/Search/index.ts +0 -1
  80. package/src/i18n/i18n.ts +2 -1
  81. package/src/index.ts +10 -13
  82. package/src/main.scss +0 -1
  83. package/src/utils/__tests__/relativeUrl-test.tsx +72 -0
  84. package/src/utils/relativeUrl.ts +19 -2
  85. package/es/CopyParagraphButton/CopyParagraphButtonV2.js +0 -87
  86. package/es/CopyParagraphButton/initCopyParagraphButtons.js +0 -29
  87. package/es/FactBox/FactBoxV2.js +0 -93
  88. package/es/Figure/FigureBylineExpandButton.js +0 -29
  89. package/es/Figure/FigureExpandButton.js +0 -30
  90. package/es/FileList/FileListV2.js +0 -47
  91. package/es/FileList/FileV2.js +0 -32
  92. package/es/Masthead/MastheadSearchModal.js +0 -82
  93. package/es/Messages/MessageBoxTag.js +0 -33
  94. package/es/MultidisciplinarySubject/List.js +0 -52
  95. package/es/MultidisciplinarySubject/ListItem.js +0 -90
  96. package/es/MultidisciplinarySubject/MultidisciplinarySubject.js +0 -125
  97. package/es/MultidisciplinarySubject/index.js +0 -10
  98. package/es/Navigation/NavigationTopicAbout.js +0 -164
  99. package/es/RelatedArticleList/RelatedArticleV2.js +0 -125
  100. package/es/Search/ToggleSearchButton.js +0 -51
  101. package/es/Translation/Translation.js +0 -33
  102. package/es/Translation/TranslationLine.js +0 -47
  103. package/es/Translation/index.js +0 -2
  104. package/lib/CopyParagraphButton/CopyParagraphButtonV2.d.ts +0 -15
  105. package/lib/CopyParagraphButton/CopyParagraphButtonV2.js +0 -92
  106. package/lib/CopyParagraphButton/initCopyParagraphButtons.d.ts +0 -2
  107. package/lib/CopyParagraphButton/initCopyParagraphButtons.js +0 -38
  108. package/lib/FactBox/FactBoxV2.d.ts +0 -13
  109. package/lib/FactBox/FactBoxV2.js +0 -98
  110. package/lib/Figure/FigureBylineExpandButton.d.ts +0 -16
  111. package/lib/Figure/FigureBylineExpandButton.js +0 -35
  112. package/lib/Figure/FigureExpandButton.d.ts +0 -16
  113. package/lib/Figure/FigureExpandButton.js +0 -35
  114. package/lib/FileList/FileListV2.d.ts +0 -13
  115. package/lib/FileList/FileListV2.js +0 -52
  116. package/lib/FileList/FileV2.d.ts +0 -15
  117. package/lib/FileList/FileV2.js +0 -40
  118. package/lib/Masthead/MastheadSearchModal.d.ts +0 -8
  119. package/lib/Masthead/MastheadSearchModal.js +0 -89
  120. package/lib/Messages/MessageBoxTag.d.ts +0 -12
  121. package/lib/Messages/MessageBoxTag.js +0 -40
  122. package/lib/MultidisciplinarySubject/List.d.ts +0 -7
  123. package/lib/MultidisciplinarySubject/List.js +0 -59
  124. package/lib/MultidisciplinarySubject/ListItem.d.ts +0 -10
  125. package/lib/MultidisciplinarySubject/ListItem.js +0 -97
  126. package/lib/MultidisciplinarySubject/MultidisciplinarySubject.d.ts +0 -13
  127. package/lib/MultidisciplinarySubject/MultidisciplinarySubject.js +0 -135
  128. package/lib/MultidisciplinarySubject/index.d.ts +0 -9
  129. package/lib/MultidisciplinarySubject/index.js +0 -17
  130. package/lib/Navigation/NavigationTopicAbout.d.ts +0 -13
  131. package/lib/Navigation/NavigationTopicAbout.js +0 -171
  132. package/lib/RelatedArticleList/RelatedArticleV2.d.ts +0 -26
  133. package/lib/RelatedArticleList/RelatedArticleV2.js +0 -131
  134. package/lib/Search/ToggleSearchButton.d.ts +0 -14
  135. package/lib/Search/ToggleSearchButton.js +0 -57
  136. package/lib/Translation/Translation.d.ts +0 -14
  137. package/lib/Translation/Translation.js +0 -38
  138. package/lib/Translation/TranslationLine.d.ts +0 -16
  139. package/lib/Translation/TranslationLine.js +0 -51
  140. package/lib/Translation/index.d.ts +0 -2
  141. package/lib/Translation/index.js +0 -20
  142. package/src/CopyParagraphButton/CopyParagraphButtonV2.tsx +0 -85
  143. package/src/CopyParagraphButton/initCopyParagraphButtons.tsx +0 -27
  144. package/src/FactBox/FactBoxV2.tsx +0 -56
  145. package/src/Figure/FigureBylineExpandButton.tsx +0 -34
  146. package/src/Figure/FigureExpandButton.tsx +0 -35
  147. package/src/FileList/FileListV2.tsx +0 -58
  148. package/src/FileList/FileV2.tsx +0 -33
  149. package/src/Masthead/MastheadSearchModal.tsx +0 -101
  150. package/src/Messages/MessageBoxTag.tsx +0 -34
  151. package/src/MultidisciplinarySubject/List.tsx +0 -49
  152. package/src/MultidisciplinarySubject/ListItem.tsx +0 -74
  153. package/src/MultidisciplinarySubject/MultidisciplinarySubject.tsx +0 -117
  154. package/src/MultidisciplinarySubject/index.ts +0 -11
  155. package/src/Navigation/NavigationTopicAbout.tsx +0 -171
  156. package/src/RelatedArticleList/RelatedArticleV2.tsx +0 -101
  157. package/src/Search/ToggleSearchButton.tsx +0 -64
  158. package/src/Translation/Translation.tsx +0 -29
  159. package/src/Translation/TranslationLine.tsx +0 -42
  160. package/src/Translation/component.translation.scss +0 -53
  161. package/src/Translation/index.ts +0 -2
@@ -1,64 +0,0 @@
1
- /**
2
- * Copyright (c) 2018-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 { forwardRef } from 'react';
10
- import { spacing, breakpoints, mq, misc, fonts, colors } from '@ndla/core';
11
- import { Search } from '@ndla/icons/common';
12
- import { ButtonProps, ButtonV2 } from '@ndla/button';
13
- import styled from '@emotion/styled';
14
-
15
- interface Props extends ButtonProps {
16
- ndlaFilm?: boolean;
17
- }
18
-
19
- const StyledButton = styled(ButtonV2)`
20
- border-radius: ${misc.borderRadius};
21
- border: 0;
22
- color: ${colors.brand.primary};
23
- align-items: center;
24
- background: transparent;
25
-
26
- svg {
27
- height: 24px;
28
- width: 24px;
29
- }
30
-
31
- ${fonts.sizes('16px', '32px')};
32
-
33
- &[data-film='true'] {
34
- background: ${colors.ndlaFilm.filmColorBright};
35
- color: ${colors.white};
36
- }
37
-
38
- ${mq.range({ from: breakpoints.tabletWide })} {
39
- padding: ${spacing.small} ${spacing.normal};
40
- background: ${colors.brand.greyLighter};
41
- }
42
- &:hover,
43
- &:focus,
44
- &:active {
45
- border: 0;
46
- }
47
- `;
48
-
49
- const StyledSpan = styled.span`
50
- margin-right: ${spacing.normal};
51
- font-weight: ${fonts.weight.normal};
52
- ${mq.range({ until: breakpoints.tabletWide })} {
53
- display: none;
54
- }
55
- `;
56
-
57
- const ToggleSearchButton = forwardRef<HTMLButtonElement, Props>(({ children, ndlaFilm, ...rest }, ref) => (
58
- <StyledButton data-film={ndlaFilm} type="button" ref={ref} {...rest}>
59
- <StyledSpan>{children}</StyledSpan>
60
- <Search />
61
- </StyledButton>
62
- ));
63
-
64
- export default ToggleSearchButton;
@@ -1,29 +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 { ReactNode } from 'react';
10
- import BEMHelper from 'react-bem-helper';
11
-
12
- const classes = new BEMHelper({
13
- name: 'translation',
14
- prefix: 'c-',
15
- });
16
-
17
- interface Props {
18
- children: ReactNode;
19
- index: number;
20
- }
21
-
22
- const Translation = ({ children, index }: Props) => (
23
- <div {...classes('')}>
24
- <div {...classes('index')}>{index}</div>
25
- <dl {...classes('wrapper')}>{children}</dl>
26
- </div>
27
- );
28
-
29
- export default Translation;
@@ -1,42 +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 { ReactNode } from 'react';
10
- import BEMHelper from 'react-bem-helper';
11
-
12
- const classes = new BEMHelper({
13
- name: 'translation',
14
- prefix: 'c-',
15
- });
16
-
17
- interface Props {
18
- isTerm?: boolean;
19
- children: ReactNode;
20
- lang?: string;
21
- langName?: string;
22
- }
23
-
24
- const TranslationLine = ({ children, lang, langName, isTerm = false }: Props) => {
25
- const hasLang = langName && lang;
26
- const content = (
27
- <>
28
- <div {...classes('line-body')} lang={lang}>
29
- {children}
30
- </div>
31
- {hasLang && <div {...classes('line-lang')}>{langName}</div>}
32
- </>
33
- );
34
-
35
- if (isTerm) {
36
- return <dt {...classes('line', hasLang ? 'lang' : '')}>{content}</dt>;
37
- }
38
-
39
- return <dd {...classes('line', hasLang ? 'lang' : '')}>{content}</dd>;
40
- };
41
-
42
- export default TranslationLine;
@@ -1,53 +0,0 @@
1
- .c-translation {
2
- display: flex;
3
- margin: $spacing 0;
4
- padding: 0 0 $spacing 0;
5
- border-bottom: 2px solid $brand-color--lighter;
6
- }
7
- .c-translation__line-lang {
8
- margin: auto 0 auto $spacing--small;
9
- background: $brand-color--secondary;
10
- color: $white;
11
- display: flex;
12
- flex-wrap: wrap;
13
- @include font-size(12px, 20px);
14
- border-radius: 2px;
15
- font-weight: 600;
16
- padding: 0 $spacing--small/3;
17
-
18
- @include mq(tablet) {
19
- margin: auto 0 auto $spacing--small;
20
- display: none;
21
- }
22
- }
23
- .c-translation__index {
24
- width: 7%;
25
- height: 100%;
26
- padding-right: $spacing--small;
27
- color: $brand-color--secondary;
28
- }
29
- .c-translation__wrapper {
30
- width: 90%;
31
- display: block;
32
- margin: 0;
33
- }
34
- .c-translation__line {
35
- padding: 2px 4px;
36
- vertical-align: middle;
37
- display: flex;
38
- margin-left: 0;
39
- }
40
- .c-translation__line-body {
41
- @include font-size(16px, 26px);
42
-
43
- @include mq(tablet) {
44
- @include font-size(18px, 30px);
45
- }
46
- }
47
-
48
- .c-translation__line--lang:hover {
49
- background: $brand-color--lighter;
50
- .c-translation__line-lang {
51
- display: inline-block;
52
- }
53
- }
@@ -1,2 +0,0 @@
1
- export { default as Translation } from './Translation';
2
- export { default as TranslationLine } from './TranslationLine';