@ndla/ui 3.2.1-alpha.8 → 3.2.1
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/AuthorInfo/AuthorInfo.js +1 -2
- package/lib/BackgroundImage/BackgroundImage.d.ts +11 -0
- package/{es/BackgroundImage/index.js → lib/BackgroundImage/index.d.ts} +1 -1
- package/lib/ContentLoader/index.d.ts +20 -0
- package/lib/Dialog/Dialog.d.ts +23 -0
- package/{es/Dialog/index.js → lib/Dialog/index.d.ts} +1 -1
- package/lib/Figure/Figure.d.ts +50 -0
- package/lib/Figure/FigureExpandButton.d.ts +16 -0
- package/lib/Figure/FigureLicense.d.ts +33 -0
- package/lib/Figure/FigureLicenseDialog.d.ts +29 -0
- package/{es/Figure/index.js → lib/Figure/index.d.ts} +1 -1
- package/lib/FileList/File.d.ts +7 -0
- package/lib/FileList/FileList.d.ts +17 -0
- package/{es/FileList/index.js → lib/FileList/index.d.ts} +1 -1
- package/lib/Hero/Hero.d.ts +26 -0
- package/{es/Hero/index.js → lib/Hero/index.d.ts} +1 -1
- package/lib/Image/Image.d.ts +25 -0
- package/lib/Image/ImageLink.d.ts +18 -0
- package/lib/Image/LazyLoadImage.d.ts +17 -0
- package/{es/Image/index.js → lib/Image/index.d.ts} +1 -1
- package/lib/InfoBox/InfoBox.d.ts +6 -0
- package/{src/InfoBox/index.js → lib/InfoBox/index.d.ts} +0 -0
- package/lib/InfoWidget/InfoWidget.d.ts +19 -0
- package/{es/InfoWidget/index.js → lib/InfoWidget/index.d.ts} +1 -1
- package/lib/Logo/Logo.d.ts +24 -0
- package/lib/Logo/SvgLogo.d.ts +14 -0
- package/{es/Logo/index.js → lib/Logo/index.d.ts} +1 -1
- package/lib/Masthead/Masthead.d.ts +27 -0
- package/{es/Masthead/index.js → lib/Masthead/index.d.ts} +1 -1
- package/lib/NoContentBox/NoContentBox.d.ts +14 -0
- package/{es/NoContentBox/index.js → lib/NoContentBox/index.d.ts} +1 -1
- package/lib/Portrait/Portrait.d.ts +15 -0
- package/{es/Portrait/index.js → lib/Portrait/index.d.ts} +1 -1
- package/lib/Topic/Topic.d.ts +3 -2
- package/lib/Translation/Translation.d.ts +14 -0
- package/lib/Translation/TranslationBox.d.ts +10 -0
- package/lib/Translation/TranslationLine.d.ts +16 -0
- package/{src/Translation/index.js → lib/Translation/index.d.ts} +0 -0
- package/lib/index.d.ts +14 -0
- package/lib/locale/messages-en.d.ts +4 -0
- package/lib/locale/messages-nb.d.ts +4 -0
- package/lib/locale/messages-nn.d.ts +4 -0
- package/lib/types.d.ts +10 -0
- package/package.json +6 -6
- package/src/Article/ArticleAuthorContent.tsx +0 -1
- package/src/AuthorInfo/AuthorInfo.tsx +0 -1
- package/src/BackgroundImage/BackgroundImage.tsx +32 -0
- package/src/BackgroundImage/{index.js → index.ts} +0 -0
- package/src/ContentLoader/{index.js → index.tsx} +20 -30
- package/src/Dialog/{Dialog.jsx → Dialog.tsx} +20 -32
- package/src/Dialog/{index.js → index.ts} +0 -0
- package/src/Figure/{Figure.js → Figure.tsx} +44 -54
- package/src/Figure/{FigureExpandButton.js → FigureExpandButton.tsx} +8 -9
- package/src/Figure/{FigureLicense.js → FigureLicense.tsx} +32 -30
- package/src/Figure/{FigureLicenseDialog.js → FigureLicenseDialog.tsx} +22 -22
- package/src/Figure/{index.js → index.ts} +0 -0
- package/src/FileList/{File.jsx → File.tsx} +8 -18
- package/src/FileList/FileList.tsx +36 -0
- package/src/FileList/{index.js → index.ts} +0 -0
- package/src/Hero/Hero.tsx +56 -0
- package/src/Hero/{index.js → index.ts} +0 -0
- package/src/Image/{Image.jsx → Image.tsx} +30 -30
- package/src/Image/{ImageLink.js → ImageLink.tsx} +11 -12
- package/src/Image/LazyLoadImage.tsx +40 -0
- package/src/Image/__tests__/__snapshots__/Image-test.jsx.snap +4 -3
- package/src/Image/{index.js → index.ts} +0 -0
- package/src/InfoBox/InfoBox.tsx +11 -0
- package/src/InfoBox/index.ts +1 -0
- package/src/InfoWidget/{InfoWidget.jsx → InfoWidget.tsx} +19 -26
- package/src/InfoWidget/{index.js → index.ts} +0 -0
- package/src/Logo/{Logo.jsx → Logo.tsx} +21 -28
- package/src/Logo/{SvgLogo.jsx → SvgLogo.tsx} +8 -14
- package/src/Logo/{index.js → index.ts} +0 -0
- package/src/Masthead/{Masthead.jsx → Masthead.tsx} +33 -35
- package/src/Masthead/{index.js → index.ts} +0 -0
- package/src/NoContentBox/{NoContentBox.jsx → NoContentBox.tsx} +7 -13
- package/src/NoContentBox/{index.js → index.ts} +0 -0
- package/src/Portrait/{Portrait.jsx → Portrait.tsx} +8 -14
- package/src/Portrait/{index.js → index.ts} +0 -0
- package/src/Topic/Topic.tsx +3 -2
- package/src/Translation/{Translation.jsx → Translation.tsx} +7 -8
- package/src/Translation/TranslationBox.tsx +20 -0
- package/src/Translation/{TranslationLine.jsx → TranslationLine.tsx} +11 -18
- package/{es/Translation/index.js → src/Translation/index.ts} +1 -1
- package/src/index-javascript.js +0 -29
- package/src/index.ts +35 -0
- package/src/locale/messages-en.ts +4 -0
- package/src/locale/messages-nb.ts +5 -1
- package/src/locale/messages-nn.ts +5 -1
- package/src/types.ts +12 -0
- package/es/BackgroundImage/BackgroundImage.js +0 -37
- package/es/ContentLoader/index.js +0 -96
- package/es/Dialog/Dialog.js +0 -82
- package/es/Figure/Figure.js +0 -125
- package/es/Figure/FigureExpandButton.js +0 -37
- package/es/Figure/FigureLicense.js +0 -74
- package/es/Figure/FigureLicenseDialog.js +0 -61
- package/es/FileList/File.js +0 -61
- package/es/FileList/FileList.js +0 -33
- package/es/Hero/Hero.js +0 -70
- package/es/Image/Image.js +0 -119
- package/es/Image/ImageLink.js +0 -55
- package/es/Image/LazyLoadImage.js +0 -56
- package/es/Image/shapes.js +0 -18
- package/es/InfoBox/InfoBox.js +0 -15
- package/es/InfoBox/index.js +0 -1
- package/es/InfoWidget/InfoWidget.js +0 -76
- package/es/Logo/Logo.js +0 -67
- package/es/Logo/SvgLogo.js +0 -62
- package/es/Masthead/Masthead.js +0 -88
- package/es/NoContentBox/NoContentBox.js +0 -35
- package/es/Portrait/Portrait.js +0 -41
- package/es/Translation/Translation.js +0 -27
- package/es/Translation/TranslationBox.js +0 -13
- package/es/Translation/TranslationLine.js +0 -48
- package/lib/BackgroundImage/BackgroundImage.js +0 -52
- package/lib/BackgroundImage/index.js +0 -13
- package/lib/ContentLoader/index.js +0 -102
- package/lib/Dialog/Dialog.js +0 -90
- package/lib/Dialog/index.js +0 -24
- package/lib/Figure/Figure.js +0 -139
- package/lib/Figure/FigureExpandButton.js +0 -52
- package/lib/Figure/FigureLicense.js +0 -88
- package/lib/Figure/FigureLicenseDialog.js +0 -69
- package/lib/Figure/index.js +0 -49
- package/lib/FileList/File.js +0 -77
- package/lib/FileList/FileList.js +0 -48
- package/lib/FileList/index.js +0 -21
- package/lib/Hero/Hero.js +0 -108
- package/lib/Hero/index.js +0 -55
- package/lib/Image/Image.js +0 -129
- package/lib/Image/ImageLink.js +0 -62
- package/lib/Image/LazyLoadImage.js +0 -61
- package/lib/Image/index.js +0 -38
- package/lib/Image/shapes.js +0 -33
- package/lib/InfoBox/InfoBox.js +0 -29
- package/lib/InfoBox/index.js +0 -15
- package/lib/InfoWidget/InfoWidget.js +0 -93
- package/lib/InfoWidget/index.js +0 -13
- package/lib/Logo/Logo.js +0 -93
- package/lib/Logo/SvgLogo.js +0 -68
- package/lib/Logo/index.js +0 -20
- package/lib/Masthead/Masthead.js +0 -106
- package/lib/Masthead/index.js +0 -30
- package/lib/NoContentBox/NoContentBox.js +0 -53
- package/lib/NoContentBox/index.js +0 -20
- package/lib/Portrait/Portrait.js +0 -55
- package/lib/Portrait/index.js +0 -20
- package/lib/Translation/Translation.js +0 -41
- package/lib/Translation/TranslationBox.js +0 -25
- package/lib/Translation/TranslationLine.js +0 -60
- package/lib/Translation/index.js +0 -31
- package/src/BackgroundImage/BackgroundImage.jsx +0 -39
- package/src/FileList/FileList.jsx +0 -36
- package/src/Hero/Hero.jsx +0 -38
- package/src/Image/LazyLoadImage.jsx +0 -39
- package/src/Image/shapes.js +0 -21
- package/src/InfoBox/InfoBox.jsx +0 -13
- package/src/Translation/TranslationBox.jsx +0 -12
|
@@ -10,8 +10,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import BEMHelper from 'react-bem-helper';
|
|
13
|
-
import SafeLink from '@ndla/safelink';
|
|
14
|
-
|
|
13
|
+
import SafeLink from '@ndla/safelink';
|
|
15
14
|
import Portrait from '../Portrait';
|
|
16
15
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
17
16
|
var classes = new BEMHelper({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare type ImageType = 'mobile' | 'tablet' | 'desktop' | 'wide';
|
|
2
|
+
interface Props {
|
|
3
|
+
showOverlay?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
images: {
|
|
6
|
+
url: string;
|
|
7
|
+
types: ImageType[];
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
declare const BackgroundImage: ({ images, showOverlay }: Props) => JSX.Element;
|
|
11
|
+
export default BackgroundImage;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import BackgroundImage from './BackgroundImage';
|
|
2
|
-
export default BackgroundImage;
|
|
2
|
+
export default BackgroundImage;
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import { ReactNode } from 'react';
|
|
9
|
+
interface Props {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
speed?: number;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
primaryColor?: string;
|
|
15
|
+
secondaryColor?: string;
|
|
16
|
+
preserveAspectRatio?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const ContentLoader: ({ children, width, height, preserveAspectRatio, className, primaryColor, secondaryColor, speed, ...rest }: Props) => JSX.Element;
|
|
20
|
+
export default ContentLoader;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-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 { ReactNode } from 'react';
|
|
9
|
+
interface Props {
|
|
10
|
+
id: string;
|
|
11
|
+
labelledby?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
messages?: {
|
|
16
|
+
close: string;
|
|
17
|
+
};
|
|
18
|
+
modifier?: string | string[];
|
|
19
|
+
disablePortal?: boolean;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const Dialog: ({ children, messages, id, labelledby, label, modifier, disablePortal, hidden, onClose, ...rest }: Props) => any;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { ReactNode } from 'react';
|
|
9
|
+
import { License } from '../types';
|
|
10
|
+
export declare const FigureCaption: ({ figureId, id, children, caption, authors, reuseLabel, licenseRights, locale, link, hideFigcaption, hasLinkedVideo, }: FigureCaptionProps) => JSX.Element;
|
|
11
|
+
export interface FigureLicense extends License {
|
|
12
|
+
short: string;
|
|
13
|
+
title: string;
|
|
14
|
+
userFriendlyTitle: string;
|
|
15
|
+
description: string;
|
|
16
|
+
rights: string[];
|
|
17
|
+
linkText?: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
}
|
|
20
|
+
interface FigureCaptionProps {
|
|
21
|
+
figureId: string;
|
|
22
|
+
id: string;
|
|
23
|
+
caption?: string;
|
|
24
|
+
reuseLabel: string;
|
|
25
|
+
licenseRights: string[];
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
authors?: {
|
|
28
|
+
name: string;
|
|
29
|
+
}[];
|
|
30
|
+
link?: {
|
|
31
|
+
url: string;
|
|
32
|
+
text: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
external?: boolean;
|
|
35
|
+
};
|
|
36
|
+
locale?: string;
|
|
37
|
+
hideFigcaption?: boolean;
|
|
38
|
+
hasLinkedVideo?: boolean;
|
|
39
|
+
}
|
|
40
|
+
declare const Figure: ({ children, type, resizeIframe, ...rest }: Props) => JSX.Element;
|
|
41
|
+
interface Props {
|
|
42
|
+
id: string;
|
|
43
|
+
children: (params: {
|
|
44
|
+
typeClass: string;
|
|
45
|
+
}) => ReactNode | ReactNode;
|
|
46
|
+
type: 'full' | 'full-column' | 'left' | 'small-left' | 'right' | 'small-right' | 'xsmall-right' | 'xsmall-left';
|
|
47
|
+
resizeIframe?: boolean;
|
|
48
|
+
noFigcaption?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export default Figure;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-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
|
+
export declare function FigureExpandButton({ messages, typeClass }: Props): JSX.Element;
|
|
9
|
+
interface Props {
|
|
10
|
+
messages: {
|
|
11
|
+
zoomImageButtonLabel: string;
|
|
12
|
+
zoomOutImageButtonLabel: string;
|
|
13
|
+
};
|
|
14
|
+
typeClass: string;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
import { ReactNode } from 'react';
|
|
9
|
+
import BEMHelper from 'react-bem-helper';
|
|
10
|
+
import { FigureLicense } from './Figure';
|
|
11
|
+
import { Contributor } from '../types';
|
|
12
|
+
export declare const classLicenses: BEMHelper<BEMHelper.ReturnObject>;
|
|
13
|
+
interface FigureLicenseCtaProps {
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
origin?: string;
|
|
16
|
+
authors?: Contributor[];
|
|
17
|
+
messages: {
|
|
18
|
+
source: string;
|
|
19
|
+
title: string;
|
|
20
|
+
};
|
|
21
|
+
title?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const FigureLicenseCta: ({ children, messages, authors, origin, title }: FigureLicenseCtaProps) => JSX.Element;
|
|
24
|
+
interface Props {
|
|
25
|
+
messages: {
|
|
26
|
+
modelPremission?: string;
|
|
27
|
+
learnAboutLicenses: string;
|
|
28
|
+
};
|
|
29
|
+
license: FigureLicense;
|
|
30
|
+
locale: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const FigureLicenseByline: ({ messages, license, locale }: Props) => JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-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 { ReactNode } from 'react';
|
|
9
|
+
import { FigureLicense } from './Figure';
|
|
10
|
+
import { Contributor } from '../types';
|
|
11
|
+
export declare const FigureLicenseDialog: ({ children, messages, id, authors, origin, title, locale, license }: Props) => JSX.Element;
|
|
12
|
+
interface Props {
|
|
13
|
+
id: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
origin?: string;
|
|
16
|
+
authors?: Contributor[];
|
|
17
|
+
messages: {
|
|
18
|
+
modelPremission?: string;
|
|
19
|
+
close: string;
|
|
20
|
+
rulesForUse: string;
|
|
21
|
+
source: string;
|
|
22
|
+
learnAboutLicenses: string;
|
|
23
|
+
title: string;
|
|
24
|
+
};
|
|
25
|
+
title?: string;
|
|
26
|
+
license: FigureLicense;
|
|
27
|
+
locale: string;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -9,4 +9,4 @@ import Figure, { FigureCaption } from './Figure';
|
|
|
9
9
|
export { Figure, FigureCaption };
|
|
10
10
|
export { FigureLicenseDialog } from './FigureLicenseDialog';
|
|
11
11
|
export { FigureExpandButton } from './FigureExpandButton';
|
|
12
|
-
export { FigureBylineExpandButton } from './FigureBylineExpandButton';
|
|
12
|
+
export { FigureBylineExpandButton } from './FigureBylineExpandButton';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface FileType {
|
|
2
|
+
title: string;
|
|
3
|
+
formats: FileFormat[];
|
|
4
|
+
fileExists?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface FileFormat {
|
|
7
|
+
url: string;
|
|
8
|
+
fileType: string;
|
|
9
|
+
tooltip: string;
|
|
10
|
+
}
|
|
11
|
+
interface Props {
|
|
12
|
+
id: string;
|
|
13
|
+
heading: string;
|
|
14
|
+
files: FileType[];
|
|
15
|
+
}
|
|
16
|
+
declare const FileList: ({ files, heading, id }: Props) => JSX.Element;
|
|
17
|
+
export default FileList;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { ReactNode } from 'react';
|
|
9
|
+
interface HeroProps {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
contentType: 'subject-material' | 'tasks-and-activities' | 'assessment-resources' | 'subject' | 'external-learning-resources' | 'source-material' | 'learning-path' | 'topic' | 'beta' | 'ndla-film' | 'ndla-film has-image';
|
|
12
|
+
}
|
|
13
|
+
export declare const Hero: ({ children, contentType }: HeroProps) => JSX.Element;
|
|
14
|
+
interface Props {
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare const SubjectMaterialHero: (props: Props) => JSX.Element;
|
|
18
|
+
export declare const TasksAndActivitiesHero: (props: Props) => JSX.Element;
|
|
19
|
+
export declare const AssessmentResourcesHero: (props: Props) => JSX.Element;
|
|
20
|
+
export declare const SubjectHero: (props: Props) => JSX.Element;
|
|
21
|
+
export declare const ExternalLearningResourcesHero: (props: Props) => JSX.Element;
|
|
22
|
+
export declare const SourceMaterialHero: (props: Props) => JSX.Element;
|
|
23
|
+
export declare const NdlaFilmHero: ({ hasImage, ...rest }: Props & {
|
|
24
|
+
hasImage?: boolean | undefined;
|
|
25
|
+
}) => JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export { SubjectMaterialHero, TasksAndActivitiesHero, AssessmentResourcesHero, SubjectHero, ExternalLearningResourcesHero, SourceMaterialHero, Hero, NdlaFilmHero } from './Hero';
|
|
8
|
+
export { SubjectMaterialHero, TasksAndActivitiesHero, AssessmentResourcesHero, SubjectHero, ExternalLearningResourcesHero, SourceMaterialHero, Hero, NdlaFilmHero, } from './Hero';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-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 { ReactNode } from 'react';
|
|
9
|
+
import { ImageCrop, ImageFocalPoint } from '../types';
|
|
10
|
+
export declare const makeSrcQueryString: (width: number | undefined, crop?: ImageCrop | undefined, focalPoint?: ImageFocalPoint | undefined) => string;
|
|
11
|
+
interface Props {
|
|
12
|
+
alt: string;
|
|
13
|
+
src: string;
|
|
14
|
+
sizes?: string;
|
|
15
|
+
fallbackWidth?: number;
|
|
16
|
+
contentType?: string;
|
|
17
|
+
srcSet?: string;
|
|
18
|
+
lazyLoad?: boolean;
|
|
19
|
+
lazyLoadSrc?: string;
|
|
20
|
+
expandButton?: ReactNode;
|
|
21
|
+
crop?: ImageCrop;
|
|
22
|
+
focalPoint?: ImageFocalPoint;
|
|
23
|
+
}
|
|
24
|
+
declare const Image: ({ alt, src, lazyLoad, lazyLoadSrc, crop, focalPoint, contentType, sizes, expandButton, ...rest }: Props) => JSX.Element;
|
|
25
|
+
export default Image;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-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 { ReactNode } from 'react';
|
|
9
|
+
import { ImageCrop, ImageFocalPoint } from '../types';
|
|
10
|
+
interface Props {
|
|
11
|
+
src: string;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
sizes?: string;
|
|
14
|
+
crop?: ImageCrop;
|
|
15
|
+
focalPoint?: ImageFocalPoint;
|
|
16
|
+
}
|
|
17
|
+
export declare function ImageLink({ src, crop, children, ...rest }: Props): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-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
|
+
interface Props {
|
|
9
|
+
alt: string;
|
|
10
|
+
src: string;
|
|
11
|
+
sizes?: string;
|
|
12
|
+
contentType?: string;
|
|
13
|
+
srcSet?: string;
|
|
14
|
+
lazyLoadSrc?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const LazyLoadImage: ({ alt, src, srcSet, lazyLoadSrc, sizes, ...rest }: Props) => JSX.Element;
|
|
17
|
+
export default LazyLoadImage;
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
heading: string;
|
|
4
|
+
description: string;
|
|
5
|
+
mainLink: {
|
|
6
|
+
name: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
href?: string;
|
|
9
|
+
};
|
|
10
|
+
iconLinks: {
|
|
11
|
+
name: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
href?: string;
|
|
14
|
+
icon: ReactNode;
|
|
15
|
+
}[];
|
|
16
|
+
center?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const InfoWidget: ({ heading, description, mainLink, iconLinks, center }: Props) => JSX.Element;
|
|
19
|
+
export default InfoWidget;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import InfoWidget from './InfoWidget';
|
|
2
|
-
export default InfoWidget;
|
|
2
|
+
export default InfoWidget;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 BEMHelper from 'react-bem-helper';
|
|
9
|
+
export declare const logoClasses: BEMHelper<BEMHelper.ReturnObject>;
|
|
10
|
+
interface Props {
|
|
11
|
+
to?: string | {
|
|
12
|
+
pathname: string;
|
|
13
|
+
search?: string;
|
|
14
|
+
hash?: string;
|
|
15
|
+
};
|
|
16
|
+
label: string;
|
|
17
|
+
locale?: string;
|
|
18
|
+
cssModifier?: string;
|
|
19
|
+
large?: boolean;
|
|
20
|
+
name?: boolean;
|
|
21
|
+
color?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const Logo: ({ name, to, cssModifier, color, large, locale, label }: Props) => JSX.Element;
|
|
24
|
+
export default Logo;
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
interface Props {
|
|
9
|
+
name?: boolean;
|
|
10
|
+
color?: string;
|
|
11
|
+
locale?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const SvgLogo: ({ name, color, locale }: Props) => JSX.Element;
|
|
14
|
+
export default SvgLogo;
|
|
@@ -0,0 +1,27 @@
|
|
|
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, { ReactNode } from 'react';
|
|
9
|
+
import { WithTranslation } from 'react-i18next';
|
|
10
|
+
interface MastheadItemProps {
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
right?: boolean;
|
|
14
|
+
left?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const MastheadItem: ({ children, className, left, right }: MastheadItemProps) => JSX.Element;
|
|
17
|
+
interface Props {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
fixed?: boolean;
|
|
20
|
+
showLoaderWhenNeeded?: boolean;
|
|
21
|
+
infoContent?: ReactNode;
|
|
22
|
+
ndlaFilm?: boolean;
|
|
23
|
+
skipToMainContentId?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const Masthead: ({ children, fixed, infoContent, showLoaderWhenNeeded, ndlaFilm, skipToMainContentId, t, }: Props & WithTranslation) => JSX.Element;
|
|
26
|
+
declare const _default: React.ComponentType<Pick<Pick<Props & WithTranslation<"translation">, "fixed" | "children" | "t" | "tReady" | "ndlaFilm" | "infoContent" | "showLoaderWhenNeeded" | "skipToMainContentId">, "fixed" | "children" | "ndlaFilm" | "infoContent" | "showLoaderWhenNeeded" | "skipToMainContentId"> & import("react-i18next").WithTranslationProps>;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-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
|
+
interface Props {
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
buttonText?: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const NoContentBox: ({ buttonText, text, onClick }: Props) => JSX.Element;
|
|
14
|
+
export default NoContentBox;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
interface Props {
|
|
9
|
+
src: string;
|
|
10
|
+
alt: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
modifier?: 'small' | 'large';
|
|
13
|
+
}
|
|
14
|
+
declare const Portrait: ({ src, alt, modifier, className }: Props) => JSX.Element;
|
|
15
|
+
export default Portrait;
|
package/lib/Topic/Topic.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { ItemProps } from '../Navigation/NavigationBox';
|
|
10
|
+
import { ImageCrop, ImageFocalPoint } from '../types';
|
|
10
11
|
declare type VisualElementProps = {
|
|
11
12
|
type: 'image' | 'video' | 'other';
|
|
12
13
|
element: React.ReactNode;
|
|
@@ -18,8 +19,8 @@ export declare type TopicProps = {
|
|
|
18
19
|
image?: {
|
|
19
20
|
url: string;
|
|
20
21
|
alt: string;
|
|
21
|
-
crop?:
|
|
22
|
-
focalPoint?:
|
|
22
|
+
crop?: ImageCrop;
|
|
23
|
+
focalPoint?: ImageFocalPoint;
|
|
23
24
|
};
|
|
24
25
|
visualElement?: VisualElementProps;
|
|
25
26
|
resources?: React.ReactNode;
|
|
@@ -0,0 +1,14 @@
|
|
|
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 { ReactNode } from 'react';
|
|
9
|
+
interface Props {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
index: number;
|
|
12
|
+
}
|
|
13
|
+
declare const Translation: ({ children, index }: Props) => JSX.Element;
|
|
14
|
+
export default Translation;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { ReactNode } from 'react';
|
|
9
|
+
interface Props {
|
|
10
|
+
isTerm?: boolean;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
lang?: string;
|
|
13
|
+
langName?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const TranslationLine: ({ children, lang, langName, isTerm }: Props) => JSX.Element;
|
|
16
|
+
export default TranslationLine;
|
|
File without changes
|
package/lib/index.d.ts
CHANGED
|
@@ -8,12 +8,26 @@
|
|
|
8
8
|
/** @ts-ignore */
|
|
9
9
|
export * from './index-javascript';
|
|
10
10
|
export { ArticleByline, ArticleContent, ArticleFootNotes, ArticleIntroduction, ArticleTitle, ArticleWrapper, ArticleHeaderWrapper, ArticleSideBar, default as Article, } from './Article';
|
|
11
|
+
export { default as NoContentBox } from './NoContentBox';
|
|
12
|
+
export { default as Masthead, MastheadItem } from './Masthead';
|
|
13
|
+
export { default as Portrait } from './Portrait';
|
|
14
|
+
export { default as ContentLoader } from './ContentLoader';
|
|
11
15
|
export { ErrorResourceAccessDenied, default as ErrorMessage } from './ErrorMessage';
|
|
16
|
+
export { default as FileList, File } from './FileList';
|
|
12
17
|
export { BlogPost, BlogPostWrapper } from './BlogPosts';
|
|
18
|
+
export { default as Logo } from './Logo';
|
|
19
|
+
export { InfoBox } from './InfoBox';
|
|
20
|
+
export { default as InfoWidget } from './InfoWidget';
|
|
13
21
|
export { FrontpageInfo, FrontpageFilm, FrontpageToolbox, FrontpageMultidisciplinarySubject, FrontpageHeader, FrontpageSubjectIllustration, FrontpageSearch, FrontpageProgramMenu, } from './Frontpage';
|
|
22
|
+
export { default as Image, ImageLink } from './Image';
|
|
23
|
+
export { makeSrcQueryString } from './Image';
|
|
24
|
+
export { SubjectMaterialHero, TasksAndActivitiesHero, AssessmentResourcesHero, SubjectHero, ExternalLearningResourcesHero, SourceMaterialHero, Hero, NdlaFilmHero, } from './Hero';
|
|
14
25
|
export { Footer, EditorName, FooterText, FooterAuth } from './Footer';
|
|
26
|
+
export { Figure, FigureCaption, FigureLicenseDialog, FigureExpandButton } from './Figure';
|
|
15
27
|
export { LanguageSelector } from './LanguageSelector';
|
|
16
28
|
export { LearningPathWrapper, LearningPathContent, LearningPathMenu, LearningPathSticky, LearningPathInformation, LearningPathStickySibling, LearningPathStickyPlaceholder, LearningPathLastStepNavigation, LearningPathMobileStepInfo, LearningPathMobileHeader, } from './LearningPaths';
|
|
29
|
+
export { Translation, TranslationLine, TranslationBox } from './Translation';
|
|
30
|
+
export { default as Spinner } from './Spinner';
|
|
17
31
|
export { default as SearchResultSleeve } from './Search/SearchResultSleeve';
|
|
18
32
|
export { default as ContentTypeResult } from './Search/ContentTypeResult';
|
|
19
33
|
export { SearchFieldForm } from './Search/SearchFieldForm';
|