@ndla/ui 45.0.14 → 45.0.15
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/Article/Article.js +3 -3
- package/es/BlogPost/BlogPost.js +4 -4
- package/es/CampaignBlock/CampaignBlock.js +6 -6
- package/es/Frontpage/FrontpageMultidisciplinarySubject.js +7 -7
- package/es/Frontpage/FrontpageToolbox.js +4 -4
- package/es/FrontpageArticle/FrontpageArticle.js +3 -3
- package/es/InfoWidget/InfoWidget.js +8 -8
- package/es/LearningPaths/LearningPathInformation.js +4 -4
- package/es/LinkBlock/LinkBlock.js +6 -6
- package/es/MultidisciplinarySubject/MultidisciplinarySubject.js +7 -7
- package/es/Navigation/NavigationBox.js +20 -20
- package/es/Programme/Programme.js +6 -6
- package/es/RelatedArticleList/RelatedArticleV2.js +1 -1
- package/es/ResourceGroup/ResourceGroup.js +4 -4
- package/es/SectionHeading/SectionHeading.js +2 -2
- package/es/Subject/Subject.js +11 -11
- package/es/Subject/SubjectNewContent.js +8 -8
- package/es/Subject/SubjectSocial.js +2 -2
- package/es/ToolboxPage/ToolboxInfo.js +2 -2
- package/es/Topic/Topic.js +18 -18
- package/es/index.js +0 -1
- package/lib/Article/Article.js +4 -4
- package/lib/BlogPost/BlogPost.d.ts +1 -1
- package/lib/BlogPost/BlogPost.js +4 -4
- package/lib/CampaignBlock/CampaignBlock.d.ts +1 -1
- package/lib/CampaignBlock/CampaignBlock.js +6 -6
- package/lib/Frontpage/FrontpageMultidisciplinarySubject.d.ts +1 -1
- package/lib/Frontpage/FrontpageMultidisciplinarySubject.js +7 -7
- package/lib/Frontpage/FrontpageToolbox.d.ts +1 -1
- package/lib/Frontpage/FrontpageToolbox.js +4 -4
- package/lib/FrontpageArticle/FrontpageArticle.js +4 -4
- package/lib/InfoWidget/InfoWidget.d.ts +1 -1
- package/lib/InfoWidget/InfoWidget.js +8 -8
- package/lib/LearningPaths/LearningPathInformation.js +5 -5
- package/lib/LinkBlock/LinkBlock.js +7 -7
- package/lib/MultidisciplinarySubject/MultidisciplinarySubject.js +8 -8
- package/lib/Navigation/NavigationBox.js +21 -21
- package/lib/Programme/Programme.js +7 -7
- package/lib/RelatedArticleList/RelatedArticleList.d.ts +1 -1
- package/lib/RelatedArticleList/RelatedArticleV2.d.ts +1 -1
- package/lib/RelatedArticleList/RelatedArticleV2.js +1 -1
- package/lib/ResourceGroup/ResourceGroup.d.ts +1 -1
- package/lib/ResourceGroup/ResourceGroup.js +4 -4
- package/lib/SectionHeading/SectionHeading.d.ts +1 -1
- package/lib/SectionHeading/SectionHeading.js +2 -2
- package/lib/Subject/Subject.d.ts +1 -1
- package/lib/Subject/Subject.js +11 -11
- package/lib/Subject/SubjectNewContent.d.ts +1 -1
- package/lib/Subject/SubjectNewContent.js +8 -8
- package/lib/Subject/SubjectSocial.d.ts +1 -1
- package/lib/Subject/SubjectSocial.js +2 -2
- package/lib/ToolboxPage/ToolboxInfo.js +3 -3
- package/lib/Topic/Topic.js +19 -19
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -7
- package/lib/types.d.ts +0 -1
- package/package.json +17 -16
- package/src/Article/Article.tsx +1 -1
- package/src/BlogPost/BlogPost.tsx +1 -1
- package/src/CampaignBlock/CampaignBlock.tsx +1 -1
- package/src/Frontpage/FrontpageMultidisciplinarySubject.tsx +1 -1
- package/src/Frontpage/FrontpageToolbox.tsx +1 -1
- package/src/FrontpageArticle/FrontpageArticle.tsx +1 -1
- package/src/InfoWidget/InfoWidget.tsx +1 -1
- package/src/LearningPaths/LearningPathInformation.tsx +1 -1
- package/src/LinkBlock/LinkBlock.tsx +1 -1
- package/src/MultidisciplinarySubject/MultidisciplinarySubject.tsx +1 -1
- package/src/Navigation/NavigationBox.tsx +1 -1
- package/src/Programme/Programme.tsx +1 -1
- package/src/RelatedArticleList/RelatedArticleList.tsx +1 -1
- package/src/RelatedArticleList/RelatedArticleV2.tsx +1 -1
- package/src/ResourceGroup/ResourceGroup.tsx +1 -1
- package/src/SectionHeading/SectionHeading.tsx +1 -1
- package/src/Subject/Subject.tsx +1 -1
- package/src/Subject/SubjectNewContent.tsx +1 -1
- package/src/Subject/SubjectSocial.tsx +1 -1
- package/src/ToolboxPage/ToolboxInfo.tsx +1 -1
- package/src/Topic/Topic.tsx +1 -1
- package/src/index.ts +0 -2
- package/src/types.ts +0 -2
- package/es/Typography/Heading.js +0 -48
- package/es/Typography/index.js +0 -9
- package/lib/Typography/Heading.d.ts +0 -25
- package/lib/Typography/Heading.js +0 -54
- package/lib/Typography/index.d.ts +0 -8
- package/lib/Typography/index.js +0 -13
- package/src/Typography/Heading.tsx +0 -96
- package/src/Typography/index.ts +0 -9
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023-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 { css } from '@emotion/react';
|
|
10
|
-
import { breakpoints, fonts, mq, spacing } from '@ndla/core';
|
|
11
|
-
import { ComponentProps, ElementType, ReactNode } from 'react';
|
|
12
|
-
import { HeadingLevel } from '../types';
|
|
13
|
-
|
|
14
|
-
const style = css`
|
|
15
|
-
font-weight: ${fonts.weight.bold};
|
|
16
|
-
font-family: ${fonts.sans};
|
|
17
|
-
${fonts.sizes('22px', '30px')};
|
|
18
|
-
margin: ${spacing.normal} 0 ${spacing.normal} 0;
|
|
19
|
-
|
|
20
|
-
&[data-margin='none'] {
|
|
21
|
-
margin: 0px;
|
|
22
|
-
}
|
|
23
|
-
&[data-margin='xlarge'] {
|
|
24
|
-
margin: ${spacing.normal} 0 ${spacing.small} 0;
|
|
25
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
26
|
-
margin-bottom: ${spacing.normal};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
&[data-margin='large'] {
|
|
30
|
-
margin-top: ${spacing.large};
|
|
31
|
-
margin-bottom: ${spacing.small};
|
|
32
|
-
}
|
|
33
|
-
&[data-margin='small'] {
|
|
34
|
-
margin-top: ${spacing.normal};
|
|
35
|
-
margin-bottom: ${spacing.small};
|
|
36
|
-
}
|
|
37
|
-
&[data-style='h1'] {
|
|
38
|
-
${fonts.sizes('30px', '36px')};
|
|
39
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
40
|
-
${fonts.sizes('48px', '60px')};
|
|
41
|
-
margin-bottom: ${spacing.normal};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&[data-style='h2'] {
|
|
46
|
-
${fonts.sizes('28px', '36px')};
|
|
47
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
48
|
-
${fonts.sizes('30px', '38px')};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&[data-style='h3'] {
|
|
53
|
-
${fonts.sizes('26px', '35px')};
|
|
54
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
55
|
-
${fonts.sizes('26px', '36px')};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
&[data-style='list-title'] {
|
|
59
|
-
${fonts.sizes('18px', '24px')};
|
|
60
|
-
text-transform: uppercase;
|
|
61
|
-
}
|
|
62
|
-
`;
|
|
63
|
-
|
|
64
|
-
type AllowedElements = HeadingLevel | 'p' | 'span';
|
|
65
|
-
|
|
66
|
-
interface Props<T extends AllowedElements> {
|
|
67
|
-
element: T;
|
|
68
|
-
headingStyle: 'h1' | 'h2' | 'h3' | 'list-title' | 'default';
|
|
69
|
-
serif?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* General usage
|
|
72
|
-
* xlarge -> h1
|
|
73
|
-
* large -> h2
|
|
74
|
-
* normal -> anything else
|
|
75
|
-
*/
|
|
76
|
-
margin?: 'xlarge' | 'large' | 'normal' | 'small' | 'none';
|
|
77
|
-
children: ReactNode;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const Heading = <T extends AllowedElements>({
|
|
81
|
-
element,
|
|
82
|
-
children,
|
|
83
|
-
headingStyle,
|
|
84
|
-
margin = 'normal',
|
|
85
|
-
serif,
|
|
86
|
-
...rest
|
|
87
|
-
}: Props<T> & ComponentProps<T>) => {
|
|
88
|
-
const Element = element as ElementType;
|
|
89
|
-
return (
|
|
90
|
-
<Element css={style} data-serif={serif} data-style={headingStyle} data-margin={margin} {...rest}>
|
|
91
|
-
{children}
|
|
92
|
-
</Element>
|
|
93
|
-
);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export default Heading;
|
package/src/Typography/index.ts
DELETED