@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.
- package/es/BlogPost/BlogPost.js +6 -6
- package/es/CampaignBlock/CampaignBlock.js +8 -8
- package/es/CopyParagraphButton/CopyParagraphButton.js +30 -58
- package/es/CopyParagraphButton/index.js +1 -3
- package/es/Embed/RelatedContentEmbed.js +3 -3
- package/es/FactBox/FactBox.js +64 -19
- package/es/FactBox/index.js +0 -1
- package/es/Figure/index.js +0 -2
- package/es/FileList/File.js +46 -24
- package/es/FileList/FileList.js +18 -14
- package/es/FileList/index.js +0 -2
- package/es/LinkBlock/LinkBlock.js +7 -7
- package/es/Messages/index.js +1 -2
- package/es/Navigation/index.js +1 -2
- package/es/RelatedArticleList/RelatedArticleList.js +80 -35
- package/es/RelatedArticleList/index.js +2 -3
- package/es/Search/index.js +0 -1
- package/es/all.css +1 -1
- package/es/i18n/i18n.js +2 -1
- package/es/index.js +9 -11
- package/es/utils/relativeUrl.js +17 -2
- package/lib/BlogPost/BlogPost.js +5 -5
- package/lib/CampaignBlock/CampaignBlock.js +7 -7
- package/lib/CopyParagraphButton/CopyParagraphButton.d.ts +5 -4
- package/lib/CopyParagraphButton/CopyParagraphButton.js +29 -57
- package/lib/CopyParagraphButton/index.d.ts +1 -3
- package/lib/CopyParagraphButton/index.js +0 -14
- package/lib/Embed/RelatedContentEmbed.js +3 -3
- package/lib/FactBox/FactBox.d.ts +1 -4
- package/lib/FactBox/FactBox.js +72 -27
- package/lib/FactBox/index.d.ts +0 -1
- package/lib/FactBox/index.js +0 -7
- package/lib/Figure/index.d.ts +0 -2
- package/lib/Figure/index.js +0 -14
- package/lib/FileList/File.d.ts +22 -3
- package/lib/FileList/File.js +45 -25
- package/lib/FileList/FileList.d.ts +10 -14
- package/lib/FileList/FileList.js +17 -15
- package/lib/FileList/index.d.ts +0 -2
- package/lib/FileList/index.js +0 -14
- package/lib/LinkBlock/LinkBlock.js +6 -6
- package/lib/Messages/index.d.ts +1 -2
- package/lib/Messages/index.js +0 -7
- package/lib/Navigation/index.d.ts +1 -2
- package/lib/Navigation/index.js +0 -7
- package/lib/RelatedArticleList/RelatedArticleList.d.ts +16 -17
- package/lib/RelatedArticleList/RelatedArticleList.js +78 -35
- package/lib/RelatedArticleList/index.d.ts +2 -3
- package/lib/RelatedArticleList/index.js +2 -12
- package/lib/Search/index.d.ts +0 -1
- package/lib/Search/index.js +0 -7
- package/lib/all.css +1 -1
- package/lib/i18n/i18n.d.ts +1 -0
- package/lib/i18n/i18n.js +4 -2
- package/lib/index.d.ts +9 -11
- package/lib/index.js +9 -89
- package/lib/utils/relativeUrl.d.ts +1 -1
- package/lib/utils/relativeUrl.js +19 -4
- package/package.json +8 -8
- package/src/BlogPost/BlogPost.tsx +2 -2
- package/src/CampaignBlock/CampaignBlock.tsx +2 -2
- package/src/CopyParagraphButton/CopyParagraphButton.tsx +24 -46
- package/src/CopyParagraphButton/index.tsx +1 -3
- package/src/Embed/RelatedContentEmbed.stories.tsx +9 -9
- package/src/Embed/RelatedContentEmbed.tsx +3 -3
- package/src/FactBox/FactBox.tsx +29 -16
- package/src/FactBox/Factbox.stories.tsx +4 -4
- package/src/FactBox/index.ts +0 -2
- package/src/Figure/index.ts +0 -2
- package/src/FileList/File.tsx +62 -32
- package/src/FileList/FileList.stories.tsx +15 -15
- package/src/FileList/FileList.tsx +21 -27
- package/src/FileList/index.ts +0 -2
- package/src/LinkBlock/LinkBlock.tsx +2 -2
- package/src/Messages/index.ts +1 -2
- package/src/Navigation/index.ts +1 -2
- package/src/RelatedArticleList/RelatedArticleList.tsx +53 -47
- package/src/RelatedArticleList/index.ts +2 -3
- package/src/Search/index.ts +0 -1
- package/src/i18n/i18n.ts +2 -1
- package/src/index.ts +10 -13
- package/src/main.scss +0 -1
- package/src/utils/__tests__/relativeUrl-test.tsx +72 -0
- package/src/utils/relativeUrl.ts +19 -2
- package/es/CopyParagraphButton/CopyParagraphButtonV2.js +0 -87
- package/es/CopyParagraphButton/initCopyParagraphButtons.js +0 -29
- package/es/FactBox/FactBoxV2.js +0 -93
- package/es/Figure/FigureBylineExpandButton.js +0 -29
- package/es/Figure/FigureExpandButton.js +0 -30
- package/es/FileList/FileListV2.js +0 -47
- package/es/FileList/FileV2.js +0 -32
- package/es/Masthead/MastheadSearchModal.js +0 -82
- package/es/Messages/MessageBoxTag.js +0 -33
- package/es/MultidisciplinarySubject/List.js +0 -52
- package/es/MultidisciplinarySubject/ListItem.js +0 -90
- package/es/MultidisciplinarySubject/MultidisciplinarySubject.js +0 -125
- package/es/MultidisciplinarySubject/index.js +0 -10
- package/es/Navigation/NavigationTopicAbout.js +0 -164
- package/es/RelatedArticleList/RelatedArticleV2.js +0 -125
- package/es/Search/ToggleSearchButton.js +0 -51
- package/es/Translation/Translation.js +0 -33
- package/es/Translation/TranslationLine.js +0 -47
- package/es/Translation/index.js +0 -2
- package/lib/CopyParagraphButton/CopyParagraphButtonV2.d.ts +0 -15
- package/lib/CopyParagraphButton/CopyParagraphButtonV2.js +0 -92
- package/lib/CopyParagraphButton/initCopyParagraphButtons.d.ts +0 -2
- package/lib/CopyParagraphButton/initCopyParagraphButtons.js +0 -38
- package/lib/FactBox/FactBoxV2.d.ts +0 -13
- package/lib/FactBox/FactBoxV2.js +0 -98
- package/lib/Figure/FigureBylineExpandButton.d.ts +0 -16
- package/lib/Figure/FigureBylineExpandButton.js +0 -35
- package/lib/Figure/FigureExpandButton.d.ts +0 -16
- package/lib/Figure/FigureExpandButton.js +0 -35
- package/lib/FileList/FileListV2.d.ts +0 -13
- package/lib/FileList/FileListV2.js +0 -52
- package/lib/FileList/FileV2.d.ts +0 -15
- package/lib/FileList/FileV2.js +0 -40
- package/lib/Masthead/MastheadSearchModal.d.ts +0 -8
- package/lib/Masthead/MastheadSearchModal.js +0 -89
- package/lib/Messages/MessageBoxTag.d.ts +0 -12
- package/lib/Messages/MessageBoxTag.js +0 -40
- package/lib/MultidisciplinarySubject/List.d.ts +0 -7
- package/lib/MultidisciplinarySubject/List.js +0 -59
- package/lib/MultidisciplinarySubject/ListItem.d.ts +0 -10
- package/lib/MultidisciplinarySubject/ListItem.js +0 -97
- package/lib/MultidisciplinarySubject/MultidisciplinarySubject.d.ts +0 -13
- package/lib/MultidisciplinarySubject/MultidisciplinarySubject.js +0 -135
- package/lib/MultidisciplinarySubject/index.d.ts +0 -9
- package/lib/MultidisciplinarySubject/index.js +0 -17
- package/lib/Navigation/NavigationTopicAbout.d.ts +0 -13
- package/lib/Navigation/NavigationTopicAbout.js +0 -171
- package/lib/RelatedArticleList/RelatedArticleV2.d.ts +0 -26
- package/lib/RelatedArticleList/RelatedArticleV2.js +0 -131
- package/lib/Search/ToggleSearchButton.d.ts +0 -14
- package/lib/Search/ToggleSearchButton.js +0 -57
- package/lib/Translation/Translation.d.ts +0 -14
- package/lib/Translation/Translation.js +0 -38
- package/lib/Translation/TranslationLine.d.ts +0 -16
- package/lib/Translation/TranslationLine.js +0 -51
- package/lib/Translation/index.d.ts +0 -2
- package/lib/Translation/index.js +0 -20
- package/src/CopyParagraphButton/CopyParagraphButtonV2.tsx +0 -85
- package/src/CopyParagraphButton/initCopyParagraphButtons.tsx +0 -27
- package/src/FactBox/FactBoxV2.tsx +0 -56
- package/src/Figure/FigureBylineExpandButton.tsx +0 -34
- package/src/Figure/FigureExpandButton.tsx +0 -35
- package/src/FileList/FileListV2.tsx +0 -58
- package/src/FileList/FileV2.tsx +0 -33
- package/src/Masthead/MastheadSearchModal.tsx +0 -101
- package/src/Messages/MessageBoxTag.tsx +0 -34
- package/src/MultidisciplinarySubject/List.tsx +0 -49
- package/src/MultidisciplinarySubject/ListItem.tsx +0 -74
- package/src/MultidisciplinarySubject/MultidisciplinarySubject.tsx +0 -117
- package/src/MultidisciplinarySubject/index.ts +0 -11
- package/src/Navigation/NavigationTopicAbout.tsx +0 -171
- package/src/RelatedArticleList/RelatedArticleV2.tsx +0 -101
- package/src/Search/ToggleSearchButton.tsx +0 -64
- package/src/Translation/Translation.tsx +0 -29
- package/src/Translation/TranslationLine.tsx +0 -42
- package/src/Translation/component.translation.scss +0 -53
- 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
|
-
}
|
package/src/Translation/index.ts
DELETED