@redocly/theme 0.1.11 → 0.1.12
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/Search/ClearIcon.js +1 -1
- package/Search/Input.js +1 -1
- package/Search/Popover.js +1 -1
- package/Search/SearchIcon.js +1 -1
- package/Sidebar/ApiCallItem.js +1 -1
- package/globalStyle.js +24 -6
- package/mocks/Link.js +1 -1
- package/package.json +1 -1
- package/src/Search/ClearIcon.tsx +1 -1
- package/src/Search/Input.tsx +7 -7
- package/src/Search/Popover.tsx +2 -2
- package/src/Search/SearchIcon.tsx +1 -1
- package/src/Sidebar/ApiCallItem.tsx +1 -2
- package/src/globalStyle.ts +624 -461
- package/src/mocks/Link.tsx +1 -1
- package/src/ui/Typography.tsx +8 -8
- package/src/ui/UniversalLink.tsx +3 -8
- package/src/utils/isUrl.ts +4 -4
- package/ui/Typography.js +8 -8
- package/ui/UniversalLink.js +1 -5
- package/utils/isUrl.d.ts +2 -2
- package/utils/isUrl.js +4 -4
- package/src/Button/Button.stories.tsx +0 -74
- package/src/Button/__tests__/Button.test.tsx +0 -42
- package/src/Button/__tests__/__snapshots__/Button.test.tsx.snap +0 -274
- package/src/CodeBlock/__tests__/CodeBlock.test.tsx +0 -12
- package/src/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap +0 -140
- package/src/CopyButton/CopyButton.stories.tsx +0 -18
- package/src/CopyButton/__tests__/CopyButton.test.tsx +0 -35
- package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +0 -17
- package/src/CopyButton/__tests__/__snapshots__/CopyButton.test.tsx.snap +0 -55
- package/src/CopyButton/__tests__/__snapshots__/CopyButtonWrapper.test.tsx.snap +0 -46
- package/src/DesignTokens/borders.stories.mdx +0 -20
- package/src/DesignTokens/colors.stories.mdx +0 -24
- package/src/DesignTokens/page-layout.stories.mdx +0 -12
- package/src/DesignTokens/tokens-generated.scss +0 -610
- package/src/DesignTokens/typography.stories.mdx +0 -36
- package/src/Footer/Footer.stories.tsx +0 -57
- package/src/Footer/__tests__/Footer.test.tsx +0 -55
- package/src/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +0 -253
- package/src/Headings/Headings.stories.tsx +0 -36
- package/src/Headings/__tests__/Headings.test.tsx +0 -24
- package/src/Headings/__tests__/__snapshots__/Headings.test.tsx.snap +0 -57
- package/src/JsonViewer/JsonViewer.stories.tsx +0 -57
- package/src/JsonViewer/__tests__/JsonViewer.test.tsx +0 -83
- package/src/JsonViewer/__tests__/__snapshots__/JsonViewer.test.tsx.snap +0 -2728
- package/src/Layout/__tests__/PageLayout.test.tsx +0 -17
- package/src/Layout/__tests__/RootLayout.test.tsx +0 -17
- package/src/Layout/__tests__/__snapshots__/PageLayout.test.tsx.snap +0 -38
- package/src/Layout/__tests__/__snapshots__/RootLayout.test.tsx.snap +0 -18
- package/src/Navbar/Navbar.stories.tsx +0 -32
- package/src/Navbar/__tests__/Navbar.test.tsx +0 -55
- package/src/Navbar/__tests__/__snapshots__/Navbar.test.tsx.snap +0 -256
- package/src/NavbarLogo/NavbarLogo.stories.tsx +0 -20
- package/src/NavbarLogo/__tests__/NavbarLogo.test.tsx +0 -47
- package/src/NavbarLogo/__tests__/__snapshots__/NavbarLogo.test.tsx.snap +0 -38
- package/src/OperationBadge/OperationBadge.stories.tsx +0 -35
- package/src/OperationBadge/__tests__/OperationBadge.test.tsx +0 -59
- package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +0 -651
- package/src/PageNavigation/PageNavigation.stories.tsx +0 -21
- package/src/PageNavigation/__tests__/NextPageLink.test.tsx +0 -29
- package/src/PageNavigation/__tests__/PageNavigation.test.tsx +0 -54
- package/src/PageNavigation/__tests__/PreviousPageLink.test.tsx +0 -29
- package/src/PageNavigation/__tests__/__snapshots__/NextPageLink.test.tsx.snap +0 -67
- package/src/PageNavigation/__tests__/__snapshots__/PageNavigation.test.tsx.snap +0 -275
- package/src/PageNavigation/__tests__/__snapshots__/PreviousPageLink.test.tsx.snap +0 -67
- package/src/Panel/CodePanel.stories.tsx +0 -26
- package/src/Panel/ContentPanel.stories.tsx +0 -26
- package/src/Panel/Panel.stories.tsx +0 -56
- package/src/Panel/__tests__/CodePanel.test.tsx +0 -26
- package/src/Panel/__tests__/ContentPanel.test.tsx +0 -26
- package/src/Panel/__tests__/Panel.test.tsx +0 -53
- package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +0 -258
- package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +0 -278
- package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +0 -398
- package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +0 -18
- package/src/SamplesPanelControls/__tests__/SamplesPanelControls.test.tsx +0 -36
- package/src/SamplesPanelControls/__tests__/__snapshots__/SamplesPanelControls.test.tsx.snap +0 -228
- package/src/Search/__tests__/Input.test.tsx +0 -13
- package/src/Search/__tests__/__snapshots__/Input.test.tsx.snap +0 -36
- package/src/SidebarLogo/SidebarLogo.stories.tsx +0 -21
- package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +0 -32
- package/src/SidebarLogo/__tests__/__snapshots__/SidebarLogo.test.tsx.snap +0 -62
- package/src/SourceCode/SourceCode.stories.tsx +0 -29
- package/src/SourceCode/__tests__/SourceCode.test.tsx +0 -48
- package/src/SourceCode/__tests__/__snapshots__/SourceCode.test.tsx.snap +0 -786
- package/src/TableOfContent/TableOfContent.stories.tsx +0 -37
- package/src/TableOfContent/__tests__/TableOfContent.test.tsx +0 -61
- package/src/TableOfContent/__tests__/__snapshots__/TableOfContent.test.tsx.snap +0 -153
- package/src/Tooltip/Tooltip.stories.tsx +0 -27
- package/src/Tooltip/__tests__/Tooltip.test.tsx +0 -41
- package/src/Tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +0 -83
- package/src/Welcome.stories.mdx +0 -7
- package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +0 -36
- package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +0 -54
- package/src/icons/ShelfIcon/__tests__/__snapshots__/ShelfIcon.test.tsx.snap +0 -235
- package/src/utils/__tests__/ClipboardService.test.ts +0 -24
- package/src/utils/__tests__/__snapshots__/highlight.test.ts.snap +0 -5
- package/src/utils/__tests__/__snapshots__/jsonToHtml.test.ts.snap +0 -5
- package/src/utils/__tests__/css-variables.test.ts +0 -20
- package/src/utils/__tests__/highlight.test.ts +0 -51
- package/src/utils/__tests__/jsonToHtml.test.ts +0 -40
- package/src/utils/__tests__/media-css.test.ts +0 -20
- package/src/utils/__tests__/theme-helpers.test.ts +0 -25
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`FormInput renders 1`] = `
|
|
4
|
-
.c0 {
|
|
5
|
-
padding: 1em 2.5em 1em 1em;
|
|
6
|
-
background-color: var(--input-background-color);
|
|
7
|
-
border-radius: var(--input-border-radius);
|
|
8
|
-
border: none;
|
|
9
|
-
outline: none;
|
|
10
|
-
color: var(--input-text-color);
|
|
11
|
-
font-size: var(--input-font-size);
|
|
12
|
-
font-family: var(--input-font-family);
|
|
13
|
-
line-height: var(--input-line-height);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.c0::-webkit-input-placeholder {
|
|
17
|
-
color: var(--input-text-color);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.c0::-moz-placeholder {
|
|
21
|
-
color: var(--input-text-color);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.c0:-ms-input-placeholder {
|
|
25
|
-
color: var(--input-text-color);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.c0::placeholder {
|
|
29
|
-
color: var(--input-text-color);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
<input
|
|
33
|
-
class="c0"
|
|
34
|
-
data-component-name="Search/Input"
|
|
35
|
-
/>
|
|
36
|
-
`;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { SidebarLogo } from '@theme/SidebarLogo';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/SidebarLogo',
|
|
8
|
-
component: SidebarLogo,
|
|
9
|
-
argTypes: {
|
|
10
|
-
backgroundColor: { control: 'color' },
|
|
11
|
-
},
|
|
12
|
-
} as ComponentMeta<typeof SidebarLogo>;
|
|
13
|
-
|
|
14
|
-
const Template: ComponentStory<typeof SidebarLogo> = (args) => <SidebarLogo {...args} />;
|
|
15
|
-
|
|
16
|
-
export const Default = Template.bind({});
|
|
17
|
-
Default.args = {
|
|
18
|
-
imageUrl: 'https://redocly.github.io/redoc/petstore-logo.png',
|
|
19
|
-
altText: 'Pet Store',
|
|
20
|
-
href: 'http://redocly.com/',
|
|
21
|
-
};
|
|
@@ -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
|
-
});
|