@ndlib/component-library 0.0.114 → 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.
|
@@ -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,
|