@redocly/theme 0.32.0 → 0.32.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/lib/components/CodeBlock/CodeBlock.js +10 -6
- package/lib/components/Markdown/Admonition.js +1 -0
- package/lib/components/Typography/CompactTypography.d.ts +1 -1
- package/lib/components/Typography/Typography.d.ts +1 -1
- package/lib/components/Typography/Typography.js +1 -1
- package/package.json +51 -51
- package/src/components/CodeBlock/CodeBlock.tsx +23 -17
- package/src/components/Markdown/Admonition.tsx +1 -0
- package/src/components/Typography/Typography.ts +1 -1
|
@@ -54,13 +54,17 @@ function CodeBlock({ lang, source, externalSource, header, dataTestId = 'source-
|
|
|
54
54
|
}
|
|
55
55
|
return (react_1.default.createElement(Wrapper, { "data-component-name": "CodeBlock/CodeBlock", className: className },
|
|
56
56
|
react_1.default.createElement(CodeBlock_1.CodeBlockControls, { className: header === null || header === void 0 ? void 0 : header.className, title: header === null || header === void 0 ? void 0 : header.title, controls: controls }),
|
|
57
|
-
react_1.default.createElement(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
react_1.default.createElement(ContainerWrapper, null,
|
|
58
|
+
react_1.default.createElement(CodeBlock_1.CodeBlockContainer, { ref: codeBlockRef, className: withLineNumbers ? 'line-numbers' : '', dangerouslySetInnerHTML: {
|
|
59
|
+
__html: withLineNumbers
|
|
60
|
+
? (0, utils_1.addLineNumbers)(highlightedCode, startLineNumber)
|
|
61
|
+
: highlightedCode,
|
|
62
|
+
}, "data-cy": dataTestId, withControls: true }),
|
|
63
|
+
reportDialog.visible && (react_1.default.createElement(Feedback_1.ReportDialog, Object.assign({}, reportDialog.props, { location: sourceCode, lang: lang }))))));
|
|
63
64
|
}
|
|
64
65
|
exports.CodeBlock = CodeBlock;
|
|
66
|
+
const ContainerWrapper = styled_components_1.default.div `
|
|
67
|
+
display: grid; // prevents content to overstretch
|
|
68
|
+
`;
|
|
65
69
|
const Wrapper = styled_components_1.default.div ``;
|
|
66
70
|
//# sourceMappingURL=CodeBlock.js.map
|
|
@@ -39,6 +39,7 @@ const TextContainer = styled_components_1.default.div `
|
|
|
39
39
|
display: flex;
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
gap: var(--spacing-unit);
|
|
42
|
+
width: 100%;
|
|
42
43
|
`;
|
|
43
44
|
const Heading = styled_components_1.default.div `
|
|
44
45
|
letter-spacing: var(--admonition-heading-letter-spacing);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CompactTypography: import("styled-components").StyledComponent<"
|
|
1
|
+
export declare const CompactTypography: import("styled-components").StyledComponent<"span", any, import("../../components/Typography/Typography").TypographyProps & {
|
|
2
2
|
mt: string;
|
|
3
3
|
mb: string;
|
|
4
4
|
'data-component-name': string;
|
|
@@ -10,4 +10,4 @@ export interface TypographyProps {
|
|
|
10
10
|
marginTop?: string;
|
|
11
11
|
textAlign?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const Typography: import("styled-components").StyledComponent<"
|
|
13
|
+
export declare const Typography: import("styled-components").StyledComponent<"span", any, TypographyProps, never>;
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Typography = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.Typography = styled_components_1.default.
|
|
8
|
+
exports.Typography = styled_components_1.default.span.attrs(({ className }) => ({
|
|
9
9
|
'data-component-name': 'Typography/Typography',
|
|
10
10
|
className,
|
|
11
11
|
})) `
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -28,57 +28,57 @@
|
|
|
28
28
|
"styled-system": "^5.1.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@storybook/addon-actions": "
|
|
32
|
-
"@storybook/addon-essentials": "
|
|
33
|
-
"@storybook/addon-interactions": "
|
|
34
|
-
"@storybook/addon-links": "
|
|
35
|
-
"@storybook/addon-viewport": "
|
|
36
|
-
"@storybook/addons": "
|
|
37
|
-
"@storybook/core-common": "
|
|
38
|
-
"@storybook/node-logger": "
|
|
39
|
-
"@storybook/react": "
|
|
40
|
-
"@storybook/react-webpack5": "
|
|
41
|
-
"@storybook/testing-library": "
|
|
42
|
-
"@storybook/theming": "
|
|
43
|
-
"@testing-library/jest-dom": "
|
|
44
|
-
"@testing-library/react": "
|
|
45
|
-
"@testing-library/user-event": "
|
|
46
|
-
"@types/highlight-words-core": "
|
|
47
|
-
"@types/jest": "
|
|
48
|
-
"@types/jest-when": "
|
|
49
|
-
"@types/lodash.throttle": "
|
|
50
|
-
"@types/node": "
|
|
51
|
-
"@types/prismjs": "
|
|
52
|
-
"@types/react": "
|
|
53
|
-
"@types/react-dom": "
|
|
54
|
-
"@types/styled-components": "
|
|
55
|
-
"@types/styled-system": "
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "
|
|
57
|
-
"@typescript-eslint/parser": "
|
|
58
|
-
"chromatic": "
|
|
59
|
-
"concurrently": "
|
|
60
|
-
"jest": "
|
|
61
|
-
"jest-environment-jsdom": "
|
|
62
|
-
"jest-styled-components": "
|
|
63
|
-
"jest-when": "
|
|
64
|
-
"json-schema-to-ts": "
|
|
65
|
-
"lodash.throttle": "
|
|
66
|
-
"npm-run-all": "
|
|
67
|
-
"react-refresh": "
|
|
68
|
-
"react-router-dom": "
|
|
69
|
-
"storybook": "
|
|
70
|
-
"storybook-addon-pseudo-states": "
|
|
31
|
+
"@storybook/addon-actions": "7.6.4",
|
|
32
|
+
"@storybook/addon-essentials": "7.6.4",
|
|
33
|
+
"@storybook/addon-interactions": "7.6.4",
|
|
34
|
+
"@storybook/addon-links": "7.6.4",
|
|
35
|
+
"@storybook/addon-viewport": "7.6.4",
|
|
36
|
+
"@storybook/addons": "7.6.4",
|
|
37
|
+
"@storybook/core-common": "7.6.4",
|
|
38
|
+
"@storybook/node-logger": "7.6.4",
|
|
39
|
+
"@storybook/react": "7.6.4",
|
|
40
|
+
"@storybook/react-webpack5": "7.6.4",
|
|
41
|
+
"@storybook/testing-library": "0.2.2",
|
|
42
|
+
"@storybook/theming": "7.6.4",
|
|
43
|
+
"@testing-library/jest-dom": "6.1.5",
|
|
44
|
+
"@testing-library/react": "14.1.2",
|
|
45
|
+
"@testing-library/user-event": "14.5.1",
|
|
46
|
+
"@types/highlight-words-core": "1.2.3",
|
|
47
|
+
"@types/jest": "29.5.11",
|
|
48
|
+
"@types/jest-when": "3.5.5",
|
|
49
|
+
"@types/lodash.throttle": "4.1.9",
|
|
50
|
+
"@types/node": "18.19.3",
|
|
51
|
+
"@types/prismjs": "1.26.3",
|
|
52
|
+
"@types/react": "18.2.45",
|
|
53
|
+
"@types/react-dom": "18.2.17",
|
|
54
|
+
"@types/styled-components": "5.1.34",
|
|
55
|
+
"@types/styled-system": "5.1.22",
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "5.55.0",
|
|
57
|
+
"@typescript-eslint/parser": "5.55.0",
|
|
58
|
+
"chromatic": "6.17.2",
|
|
59
|
+
"concurrently": "7.6.0",
|
|
60
|
+
"jest": "29.5.0",
|
|
61
|
+
"jest-environment-jsdom": "29.5.0",
|
|
62
|
+
"jest-styled-components": "7.2.0",
|
|
63
|
+
"jest-when": "3.6.0",
|
|
64
|
+
"json-schema-to-ts": "2.7.2",
|
|
65
|
+
"lodash.throttle": "4.1.1",
|
|
66
|
+
"npm-run-all": "4.1.5",
|
|
67
|
+
"react-refresh": "0.14.0",
|
|
68
|
+
"react-router-dom": "6.10.0",
|
|
69
|
+
"storybook": "7.6.4",
|
|
70
|
+
"storybook-addon-pseudo-states": "2.1.2",
|
|
71
71
|
"storybook-design-token": "3.0.0-beta.6",
|
|
72
|
-
"styled-components": "
|
|
73
|
-
"styled-system": "
|
|
74
|
-
"ts-jest": "
|
|
75
|
-
"ts-node": "
|
|
76
|
-
"ts-node-dev": "
|
|
77
|
-
"tsc-alias": "
|
|
78
|
-
"tsconfig-paths": "
|
|
79
|
-
"tsconfig-paths-webpack-plugin": "
|
|
80
|
-
"typescript": "
|
|
81
|
-
"webpack": "
|
|
72
|
+
"styled-components": "5.3.11",
|
|
73
|
+
"styled-system": "5.1.5",
|
|
74
|
+
"ts-jest": "29.1.1",
|
|
75
|
+
"ts-node": "10.9.1",
|
|
76
|
+
"ts-node-dev": "2.0.0",
|
|
77
|
+
"tsc-alias": "1.8.3",
|
|
78
|
+
"tsconfig-paths": "4.2.0",
|
|
79
|
+
"tsconfig-paths-webpack-plugin": "3.5.2",
|
|
80
|
+
"typescript": "5.2.2",
|
|
81
|
+
"webpack": "5.88.2",
|
|
82
82
|
"@redocly/portal-types": "1.2.1"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
@@ -79,26 +79,32 @@ export function CodeBlock({
|
|
|
79
79
|
return (
|
|
80
80
|
<Wrapper data-component-name="CodeBlock/CodeBlock" className={className}>
|
|
81
81
|
<CodeBlockControls className={header?.className} title={header?.title} controls={controls} />
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
{reportDialog.visible && (
|
|
94
|
-
<ReportDialog
|
|
95
|
-
{...(reportDialog.props as ReportDialogProps)}
|
|
96
|
-
location={sourceCode}
|
|
97
|
-
lang={lang}
|
|
82
|
+
<ContainerWrapper>
|
|
83
|
+
<CodeBlockContainer
|
|
84
|
+
ref={codeBlockRef}
|
|
85
|
+
className={withLineNumbers ? 'line-numbers' : ''}
|
|
86
|
+
dangerouslySetInnerHTML={{
|
|
87
|
+
__html: withLineNumbers
|
|
88
|
+
? addLineNumbers(highlightedCode, startLineNumber)
|
|
89
|
+
: highlightedCode,
|
|
90
|
+
}}
|
|
91
|
+
data-cy={dataTestId}
|
|
92
|
+
withControls={true}
|
|
98
93
|
/>
|
|
99
|
-
|
|
94
|
+
{reportDialog.visible && (
|
|
95
|
+
<ReportDialog
|
|
96
|
+
{...(reportDialog.props as ReportDialogProps)}
|
|
97
|
+
location={sourceCode}
|
|
98
|
+
lang={lang}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
</ContainerWrapper>
|
|
100
102
|
</Wrapper>
|
|
101
103
|
);
|
|
102
104
|
}
|
|
103
105
|
|
|
106
|
+
const ContainerWrapper = styled.div`
|
|
107
|
+
display: grid; // prevents content to overstretch
|
|
108
|
+
`;
|
|
109
|
+
|
|
104
110
|
const Wrapper = styled.div``;
|
|
@@ -13,7 +13,7 @@ export interface TypographyProps {
|
|
|
13
13
|
textAlign?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export const Typography = styled.
|
|
16
|
+
export const Typography = styled.span.attrs<{ className?: string }>(({ className }) => ({
|
|
17
17
|
'data-component-name': 'Typography/Typography',
|
|
18
18
|
className,
|
|
19
19
|
}))<TypographyProps>`
|