@redocly/theme 0.1.10 → 0.1.13

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.
Files changed (122) hide show
  1. package/CodeBlock/CodeBlock.js +2 -1
  2. package/Markdown/StyledMarkdown.d.ts +0 -2
  3. package/Markdown/StyledMarkdown.js +5 -16
  4. package/Markdown/index.d.ts +0 -1
  5. package/Markdown/index.js +0 -1
  6. package/Navbar/NavbarMenu.js +1 -1
  7. package/OperationBadge/OperationBadge.js +1 -1
  8. package/Search/ClearIcon.js +2 -2
  9. package/Search/Input.js +1 -1
  10. package/Search/Popover.js +1 -1
  11. package/Search/SearchIcon.js +2 -2
  12. package/Sidebar/ApiCallItem.js +1 -1
  13. package/TableOfContent/TableOfContent.js +5 -6
  14. package/globalStyle.d.ts +1 -0
  15. package/globalStyle.js +25 -3
  16. package/mocks/Link.js +4 -1
  17. package/mocks/hooks/usePageData.js +4 -1
  18. package/package.json +1 -1
  19. package/src/CodeBlock/CodeBlock.ts +3 -42
  20. package/src/Markdown/StyledMarkdown.tsx +14 -28
  21. package/src/Markdown/index.ts +0 -1
  22. package/src/Navbar/NavbarMenu.tsx +1 -1
  23. package/src/OperationBadge/OperationBadge.ts +5 -2
  24. package/src/Search/ClearIcon.tsx +12 -13
  25. package/src/Search/Input.tsx +7 -7
  26. package/src/Search/Popover.tsx +2 -2
  27. package/src/Search/SearchIcon.tsx +12 -13
  28. package/src/Sidebar/ApiCallItem.tsx +1 -2
  29. package/src/TableOfContent/TableOfContent.tsx +6 -4
  30. package/src/globalStyle.ts +829 -536
  31. package/src/mocks/Link.tsx +5 -2
  32. package/src/mocks/hooks/usePageData.ts +4 -1
  33. package/src/ui/Typography.tsx +12 -89
  34. package/src/ui/UniversalLink.tsx +3 -8
  35. package/src/utils/ClipboardService.ts +3 -86
  36. package/src/utils/isUrl.ts +4 -4
  37. package/src/utils/theme-helpers.ts +46 -0
  38. package/ui/Typography.d.ts +2 -71
  39. package/ui/Typography.js +15 -93
  40. package/ui/UniversalLink.js +1 -5
  41. package/utils/ClipboardService.d.ts +1 -5
  42. package/utils/ClipboardService.js +2 -73
  43. package/utils/isUrl.d.ts +2 -2
  44. package/utils/isUrl.js +4 -4
  45. package/utils/theme-helpers.d.ts +1 -0
  46. package/utils/theme-helpers.js +42 -2
  47. package/Markdown/CodeSample/CodeSample.d.ts +0 -8
  48. package/Markdown/CodeSample/CodeSample.js +0 -30
  49. package/Markdown/CodeSample/index.d.ts +0 -3
  50. package/Markdown/CodeSample/index.js +0 -19
  51. package/Markdown/CodeSample/styled.d.ts +0 -5
  52. package/Markdown/CodeSample/styled.js +0 -109
  53. package/Markdown/CodeSample/types.d.ts +0 -9
  54. package/Markdown/CodeSample/types.js +0 -2
  55. package/src/Button/Button.stories.tsx +0 -74
  56. package/src/Button/__tests__/Button.test.tsx +0 -42
  57. package/src/Button/__tests__/__snapshots__/Button.test.tsx.snap +0 -274
  58. package/src/CodeBlock/__tests__/CodeBlock.test.tsx +0 -12
  59. package/src/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap +0 -140
  60. package/src/CopyButton/CopyButton.stories.tsx +0 -18
  61. package/src/CopyButton/__tests__/CopyButton.test.tsx +0 -35
  62. package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +0 -17
  63. package/src/CopyButton/__tests__/__snapshots__/CopyButton.test.tsx.snap +0 -55
  64. package/src/CopyButton/__tests__/__snapshots__/CopyButtonWrapper.test.tsx.snap +0 -46
  65. package/src/Footer/Footer.stories.tsx +0 -57
  66. package/src/Footer/__tests__/Footer.test.tsx +0 -55
  67. package/src/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +0 -253
  68. package/src/Headings/Headings.stories.tsx +0 -36
  69. package/src/Headings/__tests__/Headings.test.tsx +0 -24
  70. package/src/Headings/__tests__/__snapshots__/Headings.test.tsx.snap +0 -57
  71. package/src/JsonViewer/JsonViewer.stories.tsx +0 -57
  72. package/src/JsonViewer/__tests__/JsonViewer.test.tsx +0 -83
  73. package/src/JsonViewer/__tests__/__snapshots__/JsonViewer.test.tsx.snap +0 -2728
  74. package/src/Layout/__tests__/PageLayout.test.tsx +0 -17
  75. package/src/Layout/__tests__/RootLayout.test.tsx +0 -17
  76. package/src/Layout/__tests__/__snapshots__/PageLayout.test.tsx.snap +0 -38
  77. package/src/Layout/__tests__/__snapshots__/RootLayout.test.tsx.snap +0 -18
  78. package/src/Markdown/CodeSample/CodeSample.tsx +0 -39
  79. package/src/Markdown/CodeSample/index.ts +0 -3
  80. package/src/Markdown/CodeSample/styled.ts +0 -289
  81. package/src/Markdown/CodeSample/types.ts +0 -40
  82. package/src/Navbar/Navbar.stories.tsx +0 -32
  83. package/src/NavbarLogo/NavbarLogo.stories.tsx +0 -20
  84. package/src/NavbarLogo/__tests__/NavbarLogo.test.tsx +0 -47
  85. package/src/NavbarLogo/__tests__/__snapshots__/NavbarLogo.test.tsx.snap +0 -38
  86. package/src/OperationBadge/OperationBadge.stories.tsx +0 -35
  87. package/src/OperationBadge/__tests__/OperationBadge.test.tsx +0 -59
  88. package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +0 -651
  89. package/src/Panel/CodePanel.stories.tsx +0 -26
  90. package/src/Panel/ContentPanel.stories.tsx +0 -26
  91. package/src/Panel/Panel.stories.tsx +0 -56
  92. package/src/Panel/__tests__/CodePanel.test.tsx +0 -26
  93. package/src/Panel/__tests__/ContentPanel.test.tsx +0 -26
  94. package/src/Panel/__tests__/Panel.test.tsx +0 -53
  95. package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +0 -258
  96. package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +0 -278
  97. package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +0 -398
  98. package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +0 -18
  99. package/src/SamplesPanelControls/__tests__/SamplesPanelControls.test.tsx +0 -36
  100. package/src/SamplesPanelControls/__tests__/__snapshots__/SamplesPanelControls.test.tsx.snap +0 -228
  101. package/src/SidebarLogo/SidebarLogo.stories.tsx +0 -21
  102. package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +0 -32
  103. package/src/SidebarLogo/__tests__/__snapshots__/SidebarLogo.test.tsx.snap +0 -62
  104. package/src/SourceCode/SourceCode.stories.tsx +0 -29
  105. package/src/SourceCode/__tests__/SourceCode.test.tsx +0 -48
  106. package/src/SourceCode/__tests__/__snapshots__/SourceCode.test.tsx.snap +0 -786
  107. package/src/TableOfContent/TableOfContent.stories.tsx +0 -39
  108. package/src/Tooltip/Tooltip.stories.tsx +0 -27
  109. package/src/Tooltip/__tests__/Tooltip.test.tsx +0 -41
  110. package/src/Tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +0 -83
  111. package/src/Welcome.stories.mdx +0 -7
  112. package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +0 -36
  113. package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +0 -54
  114. package/src/icons/ShelfIcon/__tests__/__snapshots__/ShelfIcon.test.tsx.snap +0 -235
  115. package/src/utils/__tests__/ClipboardService.test.ts +0 -24
  116. package/src/utils/__tests__/__snapshots__/highlight.test.ts.snap +0 -5
  117. package/src/utils/__tests__/__snapshots__/jsonToHtml.test.ts.snap +0 -5
  118. package/src/utils/__tests__/css-variables.test.ts +0 -20
  119. package/src/utils/__tests__/highlight.test.ts +0 -51
  120. package/src/utils/__tests__/jsonToHtml.test.ts +0 -40
  121. package/src/utils/__tests__/media-css.test.ts +0 -20
  122. package/src/utils/__tests__/theme-helpers.test.ts +0 -25
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
-
4
- import { SidebarLogo } from '@theme/SidebarLogo';
5
-
6
- describe('SidebarLogo', () => {
7
- it('renders', () => {
8
- const { container } = render(
9
- <SidebarLogo
10
- imageUrl="https://test.com/logo.png"
11
- href="https://test.com"
12
- dataTestId="test"
13
- />,
14
- );
15
-
16
- expect(container.firstChild).toMatchSnapshot();
17
- });
18
-
19
- it('renders without href', () => {
20
- const { container } = render(
21
- <SidebarLogo imageUrl="https://test.com/logo.png" dataTestId="test" />,
22
- );
23
-
24
- expect(container.firstChild).toMatchSnapshot();
25
- });
26
-
27
- it('renders nothing, if imageUrl not provided', () => {
28
- const { container } = render(<SidebarLogo href="https://test.com" />);
29
-
30
- expect(container.firstChild).toBeNull();
31
- });
32
- });
@@ -1,62 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`SidebarLogo renders 1`] = `
4
- .c2 {
5
- max-height: var(--logo-max-height);
6
- max-width: var(--logo-max-width);
7
- padding: var(--logo-padding);
8
- width: 100%;
9
- display: block;
10
- }
11
-
12
- .c0 {
13
- text-align: center;
14
- line-height: 0;
15
- }
16
-
17
- .c1 {
18
- display: inline-block;
19
- }
20
-
21
- <div
22
- class="c0"
23
- data-cy="test"
24
- >
25
- <a
26
- class="c1"
27
- href="https://test.com"
28
- >
29
- <img
30
- alt="logo"
31
- class="c2"
32
- src="https://test.com/logo.png"
33
- />
34
- </a>
35
- </div>
36
- `;
37
-
38
- exports[`SidebarLogo renders without href 1`] = `
39
- .c1 {
40
- max-height: var(--logo-max-height);
41
- max-width: var(--logo-max-width);
42
- padding: var(--logo-padding);
43
- width: 100%;
44
- display: block;
45
- }
46
-
47
- .c0 {
48
- text-align: center;
49
- line-height: 0;
50
- }
51
-
52
- <div
53
- class="c0"
54
- data-cy="test"
55
- >
56
- <img
57
- alt="logo"
58
- class="c1"
59
- src="https://test.com/logo.png"
60
- />
61
- </div>
62
- `;
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import { ComponentStory, ComponentMeta } from '@storybook/react';
3
-
4
- import { SourceCode } from '@theme/SourceCode';
5
-
6
- export default {
7
- title: 'Components/SourceCode',
8
- component: SourceCode,
9
- } as ComponentMeta<typeof SourceCode>;
10
-
11
- const Template: ComponentStory<typeof SourceCode> = (args) => <SourceCode {...args} />;
12
-
13
- export const WithoutCopyButton = Template.bind({});
14
- WithoutCopyButton.args = {
15
- lang: 'php',
16
- source: `$client = new Rebilly\\Client([
17
- 'apiKey' => 'YourApiKeyHere',
18
- 'baseUrl' => 'https://api.rebilly.com',
19
- ]);`,
20
- };
21
- export const WithCopyButton = Template.bind({});
22
- WithCopyButton.args = {
23
- lang: 'php',
24
- withCopyButton: true,
25
- source: `$client = new Rebilly\\Client([
26
- 'apiKey' => 'YourApiKeyHere',
27
- 'baseUrl' => 'https://api.rebilly.com',
28
- ]);`,
29
- };
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
-
3
- import { renderWithTheme } from '../../../tests/utils';
4
-
5
- import { SourceCode } from '@theme/SourceCode';
6
-
7
- describe('SourceCode', () => {
8
- it('renders without copy button', () => {
9
- const { container } = renderWithTheme(
10
- <SourceCode source={`let count = 1; count++;`} lang="js" dataTestId="without-copy-button" />,
11
- );
12
-
13
- expect(container.firstChild).toMatchSnapshot();
14
- });
15
-
16
- it('renders with copy button', () => {
17
- const { container } = renderWithTheme(
18
- <SourceCode
19
- source={`let count = 1; count++;`}
20
- lang="js"
21
- withCopyButton
22
- dataTestId="with-copy-button"
23
- />,
24
- );
25
-
26
- expect(container.firstChild).toMatchSnapshot();
27
- });
28
-
29
- it('renders with external source', () => {
30
- const { container } = renderWithTheme(
31
- <SourceCode
32
- externalSource={{ sample: { get: () => `let count = 1; count++;`, lang: 'js' } }}
33
- lang="js"
34
- dataTestId="with-external-source"
35
- />,
36
- );
37
-
38
- expect(container.firstChild).toMatchSnapshot();
39
- });
40
-
41
- it('renders with external source when it returns null', () => {
42
- const { container } = renderWithTheme(
43
- <SourceCode externalSource={{ sample: { get: () => '', lang: 'js' } }} lang="js" />,
44
- );
45
-
46
- expect(container.firstChild).toMatchSnapshot();
47
- });
48
- });