@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.
@@ -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(CodeBlock_1.CodeBlockContainer, { ref: codeBlockRef, className: withLineNumbers ? 'line-numbers' : '', dangerouslySetInnerHTML: {
58
- __html: withLineNumbers
59
- ? (0, utils_1.addLineNumbers)(highlightedCode, startLineNumber)
60
- : highlightedCode,
61
- }, "data-cy": dataTestId, withControls: true }),
62
- reportDialog.visible && (react_1.default.createElement(Feedback_1.ReportDialog, Object.assign({}, reportDialog.props, { location: sourceCode, lang: lang })))));
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<"div", any, import("../../components/Typography/Typography").TypographyProps & {
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<"div", any, TypographyProps, never>;
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.div.attrs(({ className }) => ({
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.0",
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": "^7.5.0",
32
- "@storybook/addon-essentials": "^7.5.0",
33
- "@storybook/addon-interactions": "^7.5.0",
34
- "@storybook/addon-links": "^7.5.0",
35
- "@storybook/addon-viewport": "^7.5.0",
36
- "@storybook/addons": "^7.5.0",
37
- "@storybook/core-common": "^7.5.0",
38
- "@storybook/node-logger": "^7.5.0",
39
- "@storybook/react": "^7.5.0",
40
- "@storybook/react-webpack5": "^7.5.0",
41
- "@storybook/testing-library": "^0.2.2",
42
- "@storybook/theming": "^7.5.0",
43
- "@testing-library/jest-dom": "^6.1.4",
44
- "@testing-library/react": "^14.0.0",
45
- "@testing-library/user-event": "^14.5.1",
46
- "@types/highlight-words-core": "^1.2.1",
47
- "@types/jest": "^29.2.1",
48
- "@types/jest-when": "^3.5.2",
49
- "@types/lodash.throttle": "^4.1.7",
50
- "@types/node": "^18.11.18",
51
- "@types/prismjs": "^1.26.0",
52
- "@types/react": "^18.2.31",
53
- "@types/react-dom": "^18.2.14",
54
- "@types/styled-components": "^5.1.30",
55
- "@types/styled-system": "^5.1.13",
56
- "@typescript-eslint/eslint-plugin": "^5.23.0",
57
- "@typescript-eslint/parser": "^5.23.0",
58
- "chromatic": "^6.10.2",
59
- "concurrently": "^7.4.0",
60
- "jest": "^29.2.2",
61
- "jest-environment-jsdom": "^29.2.2",
62
- "jest-styled-components": "^7.1.1",
63
- "jest-when": "^3.5.1",
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.5.0",
70
- "storybook-addon-pseudo-states": "^2.1.2",
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": "^5.3.11",
73
- "styled-system": "^5.1.5",
74
- "ts-jest": "^29.0.3",
75
- "ts-node": "^10.7.0",
76
- "ts-node-dev": "^2.0.0",
77
- "tsc-alias": "^1.8.2",
78
- "tsconfig-paths": "^4.2.0",
79
- "tsconfig-paths-webpack-plugin": "^3.5.2",
80
- "typescript": "^5.2.2",
81
- "webpack": "^5.72.0",
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
- <CodeBlockContainer
83
- ref={codeBlockRef}
84
- className={withLineNumbers ? 'line-numbers' : ''}
85
- dangerouslySetInnerHTML={{
86
- __html: withLineNumbers
87
- ? addLineNumbers(highlightedCode, startLineNumber)
88
- : highlightedCode,
89
- }}
90
- data-cy={dataTestId}
91
- withControls={true}
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``;
@@ -64,6 +64,7 @@ const TextContainer = styled.div`
64
64
  display: flex;
65
65
  flex-direction: column;
66
66
  gap: var(--spacing-unit);
67
+ width: 100%;
67
68
  `;
68
69
 
69
70
  const Heading = styled.div<AdmonitionTypeProps>`
@@ -13,7 +13,7 @@ export interface TypographyProps {
13
13
  textAlign?: string;
14
14
  }
15
15
 
16
- export const Typography = styled.div.attrs<{ className?: string }>(({ className }) => ({
16
+ export const Typography = styled.span.attrs<{ className?: string }>(({ className }) => ({
17
17
  'data-component-name': 'Typography/Typography',
18
18
  className,
19
19
  }))<TypographyProps>`