@ndlib/component-library 0.0.113 → 0.0.115
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/dist/components/composites/Seo/index.js +2 -2
- package/dist/components/elements/Markdown/Markdown.stories.js +5 -5
- package/dist/components/elements/Markdown/Markdown.test.js +12 -14
- package/dist/components/elements/text/Heading/index.js +1 -1
- package/dist/components/elements/text/Paragraph/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { siteMetadata } from './siteMetadata';
|
|
3
3
|
export const Seo = ({ title, description, image, nofollow, noindex, pathname, }) => {
|
|
4
4
|
const { title: defaultTitle, description: defaultDescription, image: defaultImage, nofollow: defaultNoindex, noindex: defaultNofollow, siteUrl, twitterUsername, } = siteMetadata();
|
|
@@ -11,6 +11,6 @@ export const Seo = ({ title, description, image, nofollow, noindex, pathname, })
|
|
|
11
11
|
noindex: noindex || defaultNoindex,
|
|
12
12
|
twitterUsername,
|
|
13
13
|
};
|
|
14
|
-
return (_jsxs(
|
|
14
|
+
return (_jsxs(_Fragment, { children: [seo.title ? _jsx("title", Object.assign({ "data-testid": "seo-title" }, { children: seo.title })) : null, seo.title ? (_jsx("meta", { "data-testid": "seo-twitter-title", name: "twitter:title", content: seo.title })) : null, seo.title ? (_jsx("meta", { "data-testid": "seo-og-title", property: "og:title", content: seo.title })) : null, seo.url ? (_jsx("meta", { "data-testid": "seo-twitter-url", name: "twitter:url", content: seo.url })) : null, seo.url ? (_jsx("meta", { "data-testid": "seo-og-url", property: "og:url", content: seo.url })) : null, seo.description ? (_jsx("meta", { "data-testid": "seo-twitter-description", name: "twitter:description", content: seo.description })) : null, seo.description ? (_jsx("meta", { "data-testid": "seo-og-description", property: "og:description", content: seo.description })) : null, seo.image ? (_jsx("meta", { "data-testid": "seo-twitter-image", name: "twitter:image", content: seo.image })) : null, seo.image ? (_jsx("meta", { "data-testid": "seo-og-image", name: "og:image", content: seo.image })) : null, seo.twitterUsername ? (_jsx("meta", { "data-testid": "seo-twitter-creator", name: "twitter:creator", content: seo.twitterUsername })) : null, seo.nofollow ? (_jsx("meta", { "data-testid": "seo-nofollow", name: "robots", content: "nofollow" })) : null, seo.noindex ? (_jsx("meta", { "data-testid": "seo-noindex", name: "robots", content: "noindex" })) : null, _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" })] }));
|
|
15
15
|
};
|
|
16
16
|
export default Seo;
|
|
@@ -21,21 +21,21 @@ This paragraph has __bold content__ and **more bold content** and _italic conten
|
|
|
21
21
|
# Image
|
|
22
22
|

|
|
23
23
|
|
|
24
|
-
# Heading
|
|
24
|
+
# Heading 2
|
|
25
25
|
${sampleParagraph}
|
|
26
26
|
|
|
27
27
|
${sampleParagraph}
|
|
28
28
|
|
|
29
|
-
## Heading
|
|
29
|
+
## Heading 3
|
|
30
30
|
${sampleParagraph}
|
|
31
31
|
|
|
32
|
-
### Heading
|
|
32
|
+
### Heading 4
|
|
33
33
|
${sampleParagraph}
|
|
34
34
|
|
|
35
|
-
#### Heading
|
|
35
|
+
#### Heading 5
|
|
36
36
|
${sampleParagraph}
|
|
37
37
|
|
|
38
|
-
##### Heading
|
|
38
|
+
##### Heading 6
|
|
39
39
|
${sampleParagraph}
|
|
40
40
|
|
|
41
41
|
###### Heading 6
|
|
@@ -8,17 +8,15 @@ This paragraph has __bold content__ and **more bold content** and _italic conten
|
|
|
8
8
|
# Image
|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
# Heading
|
|
11
|
+
# Heading 2
|
|
12
12
|
|
|
13
|
-
## Heading
|
|
13
|
+
## Heading 3
|
|
14
14
|
|
|
15
|
-
### Heading
|
|
15
|
+
### Heading 4
|
|
16
16
|
|
|
17
|
-
#### Heading
|
|
17
|
+
#### Heading 5
|
|
18
18
|
|
|
19
|
-
##### Heading
|
|
20
|
-
|
|
21
|
-
###### Heading 6
|
|
19
|
+
##### Heading 6
|
|
22
20
|
|
|
23
21
|
- List item 1
|
|
24
22
|
- List item 2
|
|
@@ -61,32 +59,32 @@ const htmlMarkdown = `
|
|
|
61
59
|
${testMarkdown}
|
|
62
60
|
`;
|
|
63
61
|
describe('Markdown', () => {
|
|
64
|
-
it('renders
|
|
62
|
+
it('renders markdown content', () => {
|
|
65
63
|
const { getAllByRole, getByRole, container } = render(_jsx(Markdown, { content: testMarkdown }));
|
|
66
64
|
expect(() => {
|
|
67
65
|
getByRole('heading', {
|
|
68
|
-
name: 'Heading
|
|
66
|
+
name: 'Heading 2',
|
|
69
67
|
level: 1,
|
|
70
68
|
});
|
|
71
69
|
}).toThrow();
|
|
72
70
|
expect(getByRole('heading', {
|
|
73
|
-
name: 'Heading
|
|
71
|
+
name: 'Heading 2',
|
|
74
72
|
level: 2,
|
|
75
73
|
})).toBeInTheDocument();
|
|
76
74
|
expect(getByRole('heading', {
|
|
77
|
-
name: 'Heading
|
|
75
|
+
name: 'Heading 3',
|
|
78
76
|
level: 3,
|
|
79
77
|
})).toBeInTheDocument();
|
|
80
78
|
expect(getByRole('heading', {
|
|
81
|
-
name: 'Heading
|
|
79
|
+
name: 'Heading 4',
|
|
82
80
|
level: 4,
|
|
83
81
|
})).toBeInTheDocument();
|
|
84
82
|
expect(getByRole('heading', {
|
|
85
|
-
name: 'Heading
|
|
83
|
+
name: 'Heading 5',
|
|
86
84
|
level: 5,
|
|
87
85
|
})).toBeInTheDocument();
|
|
88
86
|
expect(getByRole('heading', {
|
|
89
|
-
name: 'Heading
|
|
87
|
+
name: 'Heading 6',
|
|
90
88
|
level: 6,
|
|
91
89
|
})).toBeInTheDocument();
|
|
92
90
|
expect(getByRole('link', {
|
|
@@ -59,7 +59,7 @@ export const Heading = (_a) => {
|
|
|
59
59
|
LEVEL_TYPOGRAPHY_MAP[level];
|
|
60
60
|
}
|
|
61
61
|
const typographyStyles = getTypographyStyles(typography);
|
|
62
|
-
const marginHeightMultiple = theme.lineHeights[typographyStyles.lineHeight] * 0.
|
|
62
|
+
const marginHeightMultiple = theme.lineHeights[typographyStyles.lineHeight] * (level > 4 ? 0.75 : 0.45);
|
|
63
63
|
const fontSize = theme.fontSizes[typographyStyles.fontSize];
|
|
64
64
|
const topMargin = multiplyRemSize({
|
|
65
65
|
size: fontSize,
|
|
@@ -29,7 +29,7 @@ export const Paragraph = (_a) => {
|
|
|
29
29
|
const theme = useTheme();
|
|
30
30
|
const typography = typographyParam || SIZE_TYPOGRAPHY_MAP[size || PARAGRAPH_SIZE.MD];
|
|
31
31
|
const typographyStyles = getTypographyStyles(typography);
|
|
32
|
-
const marginHeightMultiple = theme.lineHeights[typographyStyles.lineHeight] * 0.
|
|
32
|
+
const marginHeightMultiple = theme.lineHeights[typographyStyles.lineHeight] * 0.625;
|
|
33
33
|
const fontSize = theme.fontSizes[typographyStyles.fontSize];
|
|
34
34
|
const topMargin = multiplyRemSize({
|
|
35
35
|
size: fontSize,
|