@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
package/src/mocks/Link.tsx
CHANGED
|
@@ -5,6 +5,6 @@ import { omit } from 'lodash';
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
6
6
|
export function Link(props: any): JSX.Element {
|
|
7
7
|
// We omit "active" property to avoid "Warning: Received `false` for a non-boolean attribute `active`."
|
|
8
|
-
const filteredProps = omit(props, ['active']);
|
|
8
|
+
const filteredProps = omit(props, ['active', 'httpVerb', 'hasActiveSubItem']);
|
|
9
9
|
return <a href={filteredProps.to} {...filteredProps} />;
|
|
10
10
|
}
|
package/src/ui/Typography.tsx
CHANGED
|
@@ -25,27 +25,27 @@ export const typographyTokens = {
|
|
|
25
25
|
heading1: {
|
|
26
26
|
fontSize: 'var(--h1-font-size)',
|
|
27
27
|
fontFamily: 'var(--h-font-family)',
|
|
28
|
-
fontWeight: 'var(--font-weight-
|
|
28
|
+
fontWeight: 'var(--h1-font-weight, var(--h-font-weight))',
|
|
29
29
|
lineHeight: 'var(--h1-line-height)',
|
|
30
|
-
color: 'var(--color
|
|
30
|
+
color: 'var(--h-color)',
|
|
31
31
|
marginTop: 'var(--h1-margin-top)',
|
|
32
32
|
marginBottom: 'var(--h1-margin-bottom)',
|
|
33
33
|
},
|
|
34
34
|
heading2: {
|
|
35
35
|
fontSize: 'var(--h2-font-size)',
|
|
36
36
|
fontFamily: 'var(--h-font-family)',
|
|
37
|
-
fontWeight: 'var(--font-weight-
|
|
37
|
+
fontWeight: 'var(--h2-font-weight, var(--h-font-weight))',
|
|
38
38
|
lineHeight: 'var(--h2-line-height)',
|
|
39
|
-
color: 'var(--color
|
|
39
|
+
color: 'var(--h-color)',
|
|
40
40
|
marginTop: 'var(--h2-margin-top)',
|
|
41
41
|
marginBottom: 'var(--h2-margin-bottom)',
|
|
42
42
|
},
|
|
43
43
|
heading3: {
|
|
44
44
|
fontSize: 'var(--h3-font-size)',
|
|
45
45
|
fontFamily: 'var(--h-font-family)',
|
|
46
|
-
fontWeight: 'var(--font-weight-
|
|
46
|
+
fontWeight: 'var(--h3-font-weight, var(--h-font-weight))',
|
|
47
47
|
lineHeight: 'var(--h3-line-height)',
|
|
48
|
-
color: 'var(--color
|
|
48
|
+
color: 'var(--h-color)',
|
|
49
49
|
marginTop: 'var(--h3-margin-top)',
|
|
50
50
|
marginBottom: 'var(--h3-margin-bottom)',
|
|
51
51
|
},
|
|
@@ -139,7 +139,7 @@ export const SectionHeader = styled.h2`
|
|
|
139
139
|
font-weight: var(--font-weight-regular);
|
|
140
140
|
text-align: center;
|
|
141
141
|
margin: 2.65em 0;
|
|
142
|
-
padding:
|
|
142
|
+
padding: 0 20px;
|
|
143
143
|
font-family: var(--h-font-family);
|
|
144
144
|
`;
|
|
145
145
|
|
|
@@ -154,7 +154,7 @@ export const Typography = styled.p.attrs(() => ({
|
|
|
154
154
|
>`
|
|
155
155
|
${typography(typographyTokens.typography)};
|
|
156
156
|
color: var(--color-content);
|
|
157
|
-
${color}
|
|
157
|
+
${color};
|
|
158
158
|
margin-top: ${({ mt }) => mt || '1em'};
|
|
159
159
|
margin-bottom: ${({ mb }) => mb || '1em'};
|
|
160
160
|
${typographySystem}
|
package/src/ui/UniversalLink.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import { useLocation, LinkProps } from 'react-router-dom';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
5
|
import { isUrl } from '@theme/utils/isUrl';
|
|
6
|
-
import { replaceHashInColor } from '@theme/utils/replaceHashInColor';
|
|
7
6
|
import { Link } from '@portal/Link';
|
|
8
7
|
|
|
9
8
|
const StyledExternalLink = styled.a`
|
|
@@ -14,15 +13,11 @@ const StyledExternalLink = styled.a`
|
|
|
14
13
|
content: '';
|
|
15
14
|
display: inline-block;
|
|
16
15
|
position: absolute;
|
|
17
|
-
background
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
replaceHashInColor(
|
|
21
|
-
theme.colors.text.primary,
|
|
22
|
-
)}' d='M-408.2-318.5 98.6 4.8c0-0.1 0-0.2-0.1-0.3 0-0.1-0.1-0.2-0.1-0.3 0-0.1 0-0.1-0.1-0.2 0 0 0-0.1 0-0.1 0-0.1-0.1-0.2-0.2-0.3 0-0.1-0.1-0.2-0.2-0.3 -0.1-0.1-0.1-0.2-0.2-0.3C97.7 2.9 97.6 2.8 97.5 2.7c-0.1-0.1-0.2-0.2-0.3-0.3 -0.1-0.1-0.1-0.1-0.2-0.2 -0.1-0.1-0.2-0.2-0.3-0.2 -0.1-0.1-0.2-0.1-0.2-0.2 -0.1-0.1-0.2-0.1-0.3-0.2 -0.1 0-0.2-0.1-0.3-0.1 0 0-0.1 0-0.1-0.1 -0.1 0-0.2 0-0.2-0.1 -0.1 0-0.2-0.1-0.3-0.1 -0.1 0-0.2-0.1-0.4-0.1 -0.1 0-0.2 0-0.3 0 -0.1 0-0.3 0-0.4 0 -0.1 0-0.1 0-0.2 0L63.8 1.3c-2.5 0-4.6 2.1-4.6 4.6 0 2.5 2.1 4.6 4.6 4.5l19.3-0.1 -29.8 30.2c-1.1 1.1-1.5 2.7-1.2 4.1 0.2 0.9 0.6 1.7 1.3 2.4 0.9 0.9 2.1 1.3 3.2 1.3 1.2 0 2.3-0.5 3.2-1.4l0 0 29.8-30.2 0.1 19.3c0 2.5 2.1 4.6 4.6 4.5 1.3 0 2.4-0.5 3.2-1.4 0.8-0.8 1.3-2 1.3-3.2L98.7 5.7c0-0.1 0-0.1 0-0.2 0-0.1 0-0.2 0-0.4C98.6 5 98.6 4.9 98.6 4.8zM6.5 83.3c0 5.7 4.6 10.4 10.4 10.4l55.6 0.1c5.7 0 10.4-4.6 10.4-10.4l-0.1-40.8h6.1v40.8c0 9-7.3 16.3-16.3 16.3l-56.4-0.1c-8.6 0-15.6-7-15.6-15.6L0.6 27.8c0-9 7.3-16.3 16.3-16.3l41.1-0.1v6.1L17 17.5c-5.7 0-10.4 4.6-10.4 10.4L6.5 83.3z'/%3E%3C/svg%3E");
|
|
16
|
+
background: var(--color-content);
|
|
17
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' x='0' y='0' viewBox='0 0 100 125' enable-background='new 0 0 100 100' xml:space='preserve'%3E%3Cpath d='M-408.2-318.5 98.6 4.8c0-0.1 0-0.2-0.1-0.3 0-0.1-0.1-0.2-0.1-0.3 0-0.1 0-0.1-0.1-0.2 0 0 0-0.1 0-0.1 0-0.1-0.1-0.2-0.2-0.3 0-0.1-0.1-0.2-0.2-0.3 -0.1-0.1-0.1-0.2-0.2-0.3C97.7 2.9 97.6 2.8 97.5 2.7c-0.1-0.1-0.2-0.2-0.3-0.3 -0.1-0.1-0.1-0.1-0.2-0.2 -0.1-0.1-0.2-0.2-0.3-0.2 -0.1-0.1-0.2-0.1-0.2-0.2 -0.1-0.1-0.2-0.1-0.3-0.2 -0.1 0-0.2-0.1-0.3-0.1 0 0-0.1 0-0.1-0.1 -0.1 0-0.2 0-0.2-0.1 -0.1 0-0.2-0.1-0.3-0.1 -0.1 0-0.2-0.1-0.4-0.1 -0.1 0-0.2 0-0.3 0 -0.1 0-0.3 0-0.4 0 -0.1 0-0.1 0-0.2 0L63.8 1.3c-2.5 0-4.6 2.1-4.6 4.6 0 2.5 2.1 4.6 4.6 4.5l19.3-0.1 -29.8 30.2c-1.1 1.1-1.5 2.7-1.2 4.1 0.2 0.9 0.6 1.7 1.3 2.4 0.9 0.9 2.1 1.3 3.2 1.3 1.2 0 2.3-0.5 3.2-1.4l0 0 29.8-30.2 0.1 19.3c0 2.5 2.1 4.6 4.6 4.5 1.3 0 2.4-0.5 3.2-1.4 0.8-0.8 1.3-2 1.3-3.2L98.7 5.7c0-0.1 0-0.1 0-0.2 0-0.1 0-0.2 0-0.4C98.6 5 98.6 4.9 98.6 4.8zM6.5 83.3c0 5.7 4.6 10.4 10.4 10.4l55.6 0.1c5.7 0 10.4-4.6 10.4-10.4l-0.1-40.8h6.1v40.8c0 9-7.3 16.3-16.3 16.3l-56.4-0.1c-8.6 0-15.6-7-15.6-15.6L0.6 27.8c0-9 7.3-16.3 16.3-16.3l41.1-0.1v6.1L17 17.5c-5.7 0-10.4 4.6-10.4 10.4L6.5 83.3z'/%3E%3C/svg%3E");
|
|
18
|
+
mask-repeat: no-repeat;
|
|
23
19
|
width: 10px;
|
|
24
20
|
height: 10px;
|
|
25
|
-
background-repeat: no-repeat;
|
|
26
21
|
top: 50%;
|
|
27
22
|
right: -15px;
|
|
28
23
|
transform: translateY(-50%);
|
package/src/utils/isUrl.ts
CHANGED
|
@@ -12,16 +12,16 @@ const nonLocalhostDomainRE = /^[^\s.]+\.\S{2,}$/;
|
|
|
12
12
|
/**
|
|
13
13
|
* Loosely validate a URL `string`.
|
|
14
14
|
*
|
|
15
|
-
* @param {String}
|
|
15
|
+
* @param {String} input
|
|
16
16
|
* @return {Boolean}
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
export function isUrl(
|
|
20
|
-
if (typeof
|
|
19
|
+
export function isUrl(input: unknown): boolean {
|
|
20
|
+
if (typeof input !== 'string') {
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
const match =
|
|
24
|
+
const match = input.match(protocolAndDomainRE);
|
|
25
25
|
if (!match) {
|
|
26
26
|
return false;
|
|
27
27
|
}
|
package/ui/Typography.js
CHANGED
|
@@ -39,27 +39,27 @@ exports.typographyTokens = {
|
|
|
39
39
|
heading1: {
|
|
40
40
|
fontSize: 'var(--h1-font-size)',
|
|
41
41
|
fontFamily: 'var(--h-font-family)',
|
|
42
|
-
fontWeight: 'var(--font-weight-
|
|
42
|
+
fontWeight: 'var(--h1-font-weight, var(--h-font-weight))',
|
|
43
43
|
lineHeight: 'var(--h1-line-height)',
|
|
44
|
-
color: 'var(--color
|
|
44
|
+
color: 'var(--h-color)',
|
|
45
45
|
marginTop: 'var(--h1-margin-top)',
|
|
46
46
|
marginBottom: 'var(--h1-margin-bottom)',
|
|
47
47
|
},
|
|
48
48
|
heading2: {
|
|
49
49
|
fontSize: 'var(--h2-font-size)',
|
|
50
50
|
fontFamily: 'var(--h-font-family)',
|
|
51
|
-
fontWeight: 'var(--font-weight-
|
|
51
|
+
fontWeight: 'var(--h2-font-weight, var(--h-font-weight))',
|
|
52
52
|
lineHeight: 'var(--h2-line-height)',
|
|
53
|
-
color: 'var(--color
|
|
53
|
+
color: 'var(--h-color)',
|
|
54
54
|
marginTop: 'var(--h2-margin-top)',
|
|
55
55
|
marginBottom: 'var(--h2-margin-bottom)',
|
|
56
56
|
},
|
|
57
57
|
heading3: {
|
|
58
58
|
fontSize: 'var(--h3-font-size)',
|
|
59
59
|
fontFamily: 'var(--h-font-family)',
|
|
60
|
-
fontWeight: 'var(--font-weight-
|
|
60
|
+
fontWeight: 'var(--h3-font-weight, var(--h-font-weight))',
|
|
61
61
|
lineHeight: 'var(--h3-line-height)',
|
|
62
|
-
color: 'var(--color
|
|
62
|
+
color: 'var(--h-color)',
|
|
63
63
|
marginTop: 'var(--h3-margin-top)',
|
|
64
64
|
marginBottom: 'var(--h3-margin-bottom)',
|
|
65
65
|
},
|
|
@@ -119,10 +119,10 @@ exports.H3 = styled_components_1.default.h1.attrs(function () { return ({
|
|
|
119
119
|
var mb = _a.mb;
|
|
120
120
|
return mb && "margin-bottom: ".concat(mb, ";");
|
|
121
121
|
}, styled_system_1.color, styled_system_1.typography);
|
|
122
|
-
exports.SectionHeader = styled_components_1.default.h2(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: var(--h-color);\n font-size: 1.75em;\n font-weight: var(--font-weight-regular);\n text-align: center;\n margin: 2.65em 0;\n padding:
|
|
122
|
+
exports.SectionHeader = styled_components_1.default.h2(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: var(--h-color);\n font-size: 1.75em;\n font-weight: var(--font-weight-regular);\n text-align: center;\n margin: 2.65em 0;\n padding: 0 20px;\n font-family: var(--h-font-family);\n"], ["\n color: var(--h-color);\n font-size: 1.75em;\n font-weight: var(--font-weight-regular);\n text-align: center;\n margin: 2.65em 0;\n padding: 0 20px;\n font-family: var(--h-font-family);\n"])));
|
|
123
123
|
exports.Typography = styled_components_1.default.p.attrs(function () { return ({
|
|
124
124
|
'data-component-name': 'ui/Typography/Typography',
|
|
125
|
-
}); })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n color: var(--color-content);\n ", "
|
|
125
|
+
}); })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n color: var(--color-content);\n ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n ", "\n"], ["\n ", ";\n color: var(--color-content);\n ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n ", "\n"])), typography(exports.typographyTokens.typography), styled_system_1.color, function (_a) {
|
|
126
126
|
var mt = _a.mt;
|
|
127
127
|
return mt || '1em';
|
|
128
128
|
}, function (_a) {
|
package/ui/UniversalLink.js
CHANGED
|
@@ -23,12 +23,8 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
23
23
|
var react_router_dom_1 = require("react-router-dom");
|
|
24
24
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
25
25
|
var isUrl_1 = require("../utils/isUrl");
|
|
26
|
-
var replaceHashInColor_1 = require("../utils/replaceHashInColor");
|
|
27
26
|
var Link_1 = require("../mocks/Link");
|
|
28
|
-
var StyledExternalLink = styled_components_1.default.a(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.external-url {\n position: relative;\n\n :after {\n content: '';\n display: inline-block;\n position: absolute;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' x='0' y='0' viewBox='0 0 100 125' enable-background='new 0 0 100 100' xml:space='preserve'%3E%3Cpath
|
|
29
|
-
var theme = _a.theme;
|
|
30
|
-
return (0, replaceHashInColor_1.replaceHashInColor)(theme.colors.text.primary);
|
|
31
|
-
});
|
|
27
|
+
var StyledExternalLink = styled_components_1.default.a(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.external-url {\n position: relative;\n\n :after {\n content: '';\n display: inline-block;\n position: absolute;\n background: var(--color-content);\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' x='0' y='0' viewBox='0 0 100 125' enable-background='new 0 0 100 100' xml:space='preserve'%3E%3Cpath d='M-408.2-318.5 98.6 4.8c0-0.1 0-0.2-0.1-0.3 0-0.1-0.1-0.2-0.1-0.3 0-0.1 0-0.1-0.1-0.2 0 0 0-0.1 0-0.1 0-0.1-0.1-0.2-0.2-0.3 0-0.1-0.1-0.2-0.2-0.3 -0.1-0.1-0.1-0.2-0.2-0.3C97.7 2.9 97.6 2.8 97.5 2.7c-0.1-0.1-0.2-0.2-0.3-0.3 -0.1-0.1-0.1-0.1-0.2-0.2 -0.1-0.1-0.2-0.2-0.3-0.2 -0.1-0.1-0.2-0.1-0.2-0.2 -0.1-0.1-0.2-0.1-0.3-0.2 -0.1 0-0.2-0.1-0.3-0.1 0 0-0.1 0-0.1-0.1 -0.1 0-0.2 0-0.2-0.1 -0.1 0-0.2-0.1-0.3-0.1 -0.1 0-0.2-0.1-0.4-0.1 -0.1 0-0.2 0-0.3 0 -0.1 0-0.3 0-0.4 0 -0.1 0-0.1 0-0.2 0L63.8 1.3c-2.5 0-4.6 2.1-4.6 4.6 0 2.5 2.1 4.6 4.6 4.5l19.3-0.1 -29.8 30.2c-1.1 1.1-1.5 2.7-1.2 4.1 0.2 0.9 0.6 1.7 1.3 2.4 0.9 0.9 2.1 1.3 3.2 1.3 1.2 0 2.3-0.5 3.2-1.4l0 0 29.8-30.2 0.1 19.3c0 2.5 2.1 4.6 4.6 4.5 1.3 0 2.4-0.5 3.2-1.4 0.8-0.8 1.3-2 1.3-3.2L98.7 5.7c0-0.1 0-0.1 0-0.2 0-0.1 0-0.2 0-0.4C98.6 5 98.6 4.9 98.6 4.8zM6.5 83.3c0 5.7 4.6 10.4 10.4 10.4l55.6 0.1c5.7 0 10.4-4.6 10.4-10.4l-0.1-40.8h6.1v40.8c0 9-7.3 16.3-16.3 16.3l-56.4-0.1c-8.6 0-15.6-7-15.6-15.6L0.6 27.8c0-9 7.3-16.3 16.3-16.3l41.1-0.1v6.1L17 17.5c-5.7 0-10.4 4.6-10.4 10.4L6.5 83.3z'/%3E%3C/svg%3E\");\n mask-repeat: no-repeat;\n width: 10px;\n height: 10px;\n top: 50%;\n right: -15px;\n transform: translateY(-50%);\n }\n }\n"], ["\n &.external-url {\n position: relative;\n\n :after {\n content: '';\n display: inline-block;\n position: absolute;\n background: var(--color-content);\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' x='0' y='0' viewBox='0 0 100 125' enable-background='new 0 0 100 100' xml:space='preserve'%3E%3Cpath d='M-408.2-318.5 98.6 4.8c0-0.1 0-0.2-0.1-0.3 0-0.1-0.1-0.2-0.1-0.3 0-0.1 0-0.1-0.1-0.2 0 0 0-0.1 0-0.1 0-0.1-0.1-0.2-0.2-0.3 0-0.1-0.1-0.2-0.2-0.3 -0.1-0.1-0.1-0.2-0.2-0.3C97.7 2.9 97.6 2.8 97.5 2.7c-0.1-0.1-0.2-0.2-0.3-0.3 -0.1-0.1-0.1-0.1-0.2-0.2 -0.1-0.1-0.2-0.2-0.3-0.2 -0.1-0.1-0.2-0.1-0.2-0.2 -0.1-0.1-0.2-0.1-0.3-0.2 -0.1 0-0.2-0.1-0.3-0.1 0 0-0.1 0-0.1-0.1 -0.1 0-0.2 0-0.2-0.1 -0.1 0-0.2-0.1-0.3-0.1 -0.1 0-0.2-0.1-0.4-0.1 -0.1 0-0.2 0-0.3 0 -0.1 0-0.3 0-0.4 0 -0.1 0-0.1 0-0.2 0L63.8 1.3c-2.5 0-4.6 2.1-4.6 4.6 0 2.5 2.1 4.6 4.6 4.5l19.3-0.1 -29.8 30.2c-1.1 1.1-1.5 2.7-1.2 4.1 0.2 0.9 0.6 1.7 1.3 2.4 0.9 0.9 2.1 1.3 3.2 1.3 1.2 0 2.3-0.5 3.2-1.4l0 0 29.8-30.2 0.1 19.3c0 2.5 2.1 4.6 4.6 4.5 1.3 0 2.4-0.5 3.2-1.4 0.8-0.8 1.3-2 1.3-3.2L98.7 5.7c0-0.1 0-0.1 0-0.2 0-0.1 0-0.2 0-0.4C98.6 5 98.6 4.9 98.6 4.8zM6.5 83.3c0 5.7 4.6 10.4 10.4 10.4l55.6 0.1c5.7 0 10.4-4.6 10.4-10.4l-0.1-40.8h6.1v40.8c0 9-7.3 16.3-16.3 16.3l-56.4-0.1c-8.6 0-15.6-7-15.6-15.6L0.6 27.8c0-9 7.3-16.3 16.3-16.3l41.1-0.1v6.1L17 17.5c-5.7 0-10.4 4.6-10.4 10.4L6.5 83.3z'/%3E%3C/svg%3E\");\n mask-repeat: no-repeat;\n width: 10px;\n height: 10px;\n top: 50%;\n right: -15px;\n transform: translateY(-50%);\n }\n }\n"])));
|
|
32
28
|
// TODO: We're using our own Link component so probably filtering is not necessary here.
|
|
33
29
|
// filter out unnecessary props
|
|
34
30
|
var propsList = [
|
package/utils/isUrl.d.ts
CHANGED
package/utils/isUrl.js
CHANGED
|
@@ -12,14 +12,14 @@ var nonLocalhostDomainRE = /^[^\s.]+\.\S{2,}$/;
|
|
|
12
12
|
/**
|
|
13
13
|
* Loosely validate a URL `string`.
|
|
14
14
|
*
|
|
15
|
-
* @param {String}
|
|
15
|
+
* @param {String} input
|
|
16
16
|
* @return {Boolean}
|
|
17
17
|
*/
|
|
18
|
-
function isUrl(
|
|
19
|
-
if (typeof
|
|
18
|
+
function isUrl(input) {
|
|
19
|
+
if (typeof input !== 'string') {
|
|
20
20
|
return false;
|
|
21
21
|
}
|
|
22
|
-
var match =
|
|
22
|
+
var match = input.match(protocolAndDomainRE);
|
|
23
23
|
if (!match) {
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { Button } from '@theme/Button';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Button',
|
|
8
|
-
component: Button,
|
|
9
|
-
argTypes: {
|
|
10
|
-
size: {
|
|
11
|
-
control: 'radio',
|
|
12
|
-
options: ['small', 'medium', 'large', 'xlarge'],
|
|
13
|
-
},
|
|
14
|
-
color: {
|
|
15
|
-
control: 'radio',
|
|
16
|
-
options: ['primary', 'secondary', 'default'],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
} as ComponentMeta<typeof Button>;
|
|
20
|
-
|
|
21
|
-
const Template: ComponentStory<typeof Button> = (args) => <Button {...args}>Click</Button>;
|
|
22
|
-
|
|
23
|
-
export const Primary = Template.bind({});
|
|
24
|
-
Primary.args = {
|
|
25
|
-
color: 'primary',
|
|
26
|
-
disabled: false,
|
|
27
|
-
blinking: false,
|
|
28
|
-
fullWidth: false,
|
|
29
|
-
variant: 'contained',
|
|
30
|
-
size: 'small',
|
|
31
|
-
extraClass: 'test',
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const Secondary = Template.bind({});
|
|
35
|
-
Secondary.args = {
|
|
36
|
-
color: 'secondary',
|
|
37
|
-
disabled: false,
|
|
38
|
-
blinking: false,
|
|
39
|
-
fullWidth: false,
|
|
40
|
-
variant: 'contained',
|
|
41
|
-
size: 'small',
|
|
42
|
-
extraClass: 'test',
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const Outlined = Template.bind({});
|
|
46
|
-
Outlined.args = {
|
|
47
|
-
color: 'primary',
|
|
48
|
-
disabled: false,
|
|
49
|
-
blinking: false,
|
|
50
|
-
fullWidth: false,
|
|
51
|
-
variant: 'outlined',
|
|
52
|
-
size: 'small',
|
|
53
|
-
extraClass: 'test',
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const Disabled = Template.bind({});
|
|
57
|
-
Disabled.args = {
|
|
58
|
-
color: 'secondary',
|
|
59
|
-
disabled: true,
|
|
60
|
-
blinking: false,
|
|
61
|
-
fullWidth: false,
|
|
62
|
-
variant: 'contained',
|
|
63
|
-
size: 'small',
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const Large = Template.bind({});
|
|
67
|
-
Large.args = {
|
|
68
|
-
color: 'default',
|
|
69
|
-
disabled: false,
|
|
70
|
-
blinking: false,
|
|
71
|
-
fullWidth: false,
|
|
72
|
-
variant: 'contained',
|
|
73
|
-
size: 'large',
|
|
74
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import { Button } from '@theme/Button';
|
|
5
|
-
|
|
6
|
-
describe('Button', () => {
|
|
7
|
-
it('renders', () => {
|
|
8
|
-
const { container } = render(<Button>Test</Button>);
|
|
9
|
-
|
|
10
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('renders blinking', () => {
|
|
14
|
-
const { container } = render(<Button blinking>Test</Button>);
|
|
15
|
-
|
|
16
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('renders with extra class', () => {
|
|
20
|
-
const { container } = render(<Button extraClass="quick-fox">Test</Button>);
|
|
21
|
-
|
|
22
|
-
expect(container.firstChild).toHaveClass('quick-fox');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('renders disabled', () => {
|
|
26
|
-
const { container } = render(<Button disabled>Test</Button>);
|
|
27
|
-
|
|
28
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('renders full width', () => {
|
|
32
|
-
const { container } = render(<Button fullWidth>Test</Button>);
|
|
33
|
-
|
|
34
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('renders outlined', () => {
|
|
38
|
-
const { container } = render(<Button variant="outlined">Test</Button>);
|
|
39
|
-
|
|
40
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Button renders 1`] = `
|
|
4
|
-
.c1 {
|
|
5
|
-
-webkit-text-decoration: none;
|
|
6
|
-
text-decoration: none;
|
|
7
|
-
text-align: center;
|
|
8
|
-
width: auto;
|
|
9
|
-
outline: none;
|
|
10
|
-
border: none;
|
|
11
|
-
border-radius: var(--button-border-radius);
|
|
12
|
-
font-weight: var(--button-font-weight);
|
|
13
|
-
font-size: 14px;
|
|
14
|
-
padding: 2px 20px;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
17
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
18
|
-
line-height: 1;
|
|
19
|
-
font-family: var(--button-font-family);
|
|
20
|
-
box-shadow: var(--button-box-shadow);
|
|
21
|
-
color: var(--button-color);
|
|
22
|
-
background-color: var(--button-background-color);
|
|
23
|
-
font-size: var(--button-medium-font-size);
|
|
24
|
-
padding: var(--button-medium-padding);
|
|
25
|
-
min-width: var(--button-medium-min-width);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.c1:hover {
|
|
29
|
-
box-shadow: var(--button-active-box-shadow);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.c1:active {
|
|
33
|
-
box-shadow: var(--button-active-box-shadow);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.c1:hover {
|
|
37
|
-
background-color: var(--button-hover-background-color);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.c1:active {
|
|
41
|
-
background-color: var(--button-active-background-color);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.c0 + .c0 {
|
|
45
|
-
margin-left: 0.85em;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
<button
|
|
49
|
-
class="c0 c1 button-color-default"
|
|
50
|
-
>
|
|
51
|
-
Test
|
|
52
|
-
</button>
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
exports[`Button renders blinking 1`] = `
|
|
56
|
-
.c1 {
|
|
57
|
-
-webkit-text-decoration: none;
|
|
58
|
-
text-decoration: none;
|
|
59
|
-
text-align: center;
|
|
60
|
-
width: auto;
|
|
61
|
-
outline: none;
|
|
62
|
-
border: none;
|
|
63
|
-
border-radius: var(--button-border-radius);
|
|
64
|
-
font-weight: var(--button-font-weight);
|
|
65
|
-
font-size: 14px;
|
|
66
|
-
padding: 2px 20px;
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
69
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
70
|
-
line-height: 1;
|
|
71
|
-
font-family: var(--button-font-family);
|
|
72
|
-
box-shadow: var(--button-box-shadow);
|
|
73
|
-
color: var(--button-color);
|
|
74
|
-
background-color: var(--button-background-color);
|
|
75
|
-
font-size: var(--button-medium-font-size);
|
|
76
|
-
padding: var(--button-medium-padding);
|
|
77
|
-
min-width: var(--button-medium-min-width);
|
|
78
|
-
pointer-events: none;
|
|
79
|
-
-webkit-animation: hiqtTO 1.2s infinite;
|
|
80
|
-
animation: hiqtTO 1.2s infinite;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.c1:hover {
|
|
84
|
-
box-shadow: var(--button-active-box-shadow);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.c1:active {
|
|
88
|
-
box-shadow: var(--button-active-box-shadow);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.c1:hover {
|
|
92
|
-
background-color: var(--button-hover-background-color);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.c1:active {
|
|
96
|
-
background-color: var(--button-active-background-color);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.c0 + .c0 {
|
|
100
|
-
margin-left: 0.85em;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
<button
|
|
104
|
-
class="c0 c1 button-color-default"
|
|
105
|
-
>
|
|
106
|
-
Test
|
|
107
|
-
</button>
|
|
108
|
-
`;
|
|
109
|
-
|
|
110
|
-
exports[`Button renders disabled 1`] = `
|
|
111
|
-
.c1 {
|
|
112
|
-
-webkit-text-decoration: none;
|
|
113
|
-
text-decoration: none;
|
|
114
|
-
text-align: center;
|
|
115
|
-
width: auto;
|
|
116
|
-
outline: none;
|
|
117
|
-
border: none;
|
|
118
|
-
border-radius: var(--button-border-radius);
|
|
119
|
-
font-weight: var(--button-font-weight);
|
|
120
|
-
font-size: 14px;
|
|
121
|
-
padding: 2px 20px;
|
|
122
|
-
cursor: pointer;
|
|
123
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
124
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
125
|
-
line-height: 1;
|
|
126
|
-
font-family: var(--button-font-family);
|
|
127
|
-
box-shadow: var(--button-box-shadow);
|
|
128
|
-
color: var(--button-color);
|
|
129
|
-
background-color: var(--button-background-color);
|
|
130
|
-
font-size: var(--button-medium-font-size);
|
|
131
|
-
padding: var(--button-medium-padding);
|
|
132
|
-
min-width: var(--button-medium-min-width);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.c1:hover {
|
|
136
|
-
box-shadow: var(--button-active-box-shadow);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.c1:active {
|
|
140
|
-
box-shadow: var(--button-active-box-shadow);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.c1:hover {
|
|
144
|
-
background-color: var(--button-hover-background-color);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.c1:active {
|
|
148
|
-
background-color: var(--button-active-background-color);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.c0 + .c0 {
|
|
152
|
-
margin-left: 0.85em;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.c1,
|
|
156
|
-
.c1:hover {
|
|
157
|
-
cursor: default;
|
|
158
|
-
color: #999999;
|
|
159
|
-
pointer-events: none;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
<button
|
|
163
|
-
class="c0 c1 button-color-default"
|
|
164
|
-
disabled=""
|
|
165
|
-
>
|
|
166
|
-
Test
|
|
167
|
-
</button>
|
|
168
|
-
`;
|
|
169
|
-
|
|
170
|
-
exports[`Button renders full width 1`] = `
|
|
171
|
-
.c1 {
|
|
172
|
-
-webkit-text-decoration: none;
|
|
173
|
-
text-decoration: none;
|
|
174
|
-
text-align: center;
|
|
175
|
-
width: 100%;
|
|
176
|
-
outline: none;
|
|
177
|
-
border: none;
|
|
178
|
-
border-radius: var(--button-border-radius);
|
|
179
|
-
font-weight: var(--button-font-weight);
|
|
180
|
-
font-size: 14px;
|
|
181
|
-
padding: 2px 20px;
|
|
182
|
-
cursor: pointer;
|
|
183
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
184
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
185
|
-
line-height: 1;
|
|
186
|
-
font-family: var(--button-font-family);
|
|
187
|
-
box-shadow: var(--button-box-shadow);
|
|
188
|
-
color: var(--button-color);
|
|
189
|
-
background-color: var(--button-background-color);
|
|
190
|
-
font-size: var(--button-medium-font-size);
|
|
191
|
-
padding: var(--button-medium-padding);
|
|
192
|
-
min-width: var(--button-medium-min-width);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.c1:hover {
|
|
196
|
-
box-shadow: var(--button-active-box-shadow);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.c1:active {
|
|
200
|
-
box-shadow: var(--button-active-box-shadow);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.c1:hover {
|
|
204
|
-
background-color: var(--button-hover-background-color);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.c1:active {
|
|
208
|
-
background-color: var(--button-active-background-color);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.c0 + .c0 {
|
|
212
|
-
margin-left: 0.85em;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
<button
|
|
216
|
-
class="c0 c1 button-color-default"
|
|
217
|
-
>
|
|
218
|
-
Test
|
|
219
|
-
</button>
|
|
220
|
-
`;
|
|
221
|
-
|
|
222
|
-
exports[`Button renders outlined 1`] = `
|
|
223
|
-
.c1 {
|
|
224
|
-
-webkit-text-decoration: none;
|
|
225
|
-
text-decoration: none;
|
|
226
|
-
text-align: center;
|
|
227
|
-
width: auto;
|
|
228
|
-
outline: none;
|
|
229
|
-
border: none;
|
|
230
|
-
border-radius: var(--button-border-radius);
|
|
231
|
-
font-weight: var(--button-font-weight);
|
|
232
|
-
font-size: 14px;
|
|
233
|
-
padding: 2px 20px;
|
|
234
|
-
cursor: pointer;
|
|
235
|
-
-webkit-transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
236
|
-
transition: background-color 0.25s ease,border-color 0.25s ease,box-shadow 0.25s ease;
|
|
237
|
-
line-height: 1;
|
|
238
|
-
font-family: var(--button-font-family);
|
|
239
|
-
box-shadow: var(--button-box-shadow);
|
|
240
|
-
color: var(--button-background-color);
|
|
241
|
-
border: 2px solid var(--button-background-color);
|
|
242
|
-
background-color: transparent;
|
|
243
|
-
font-size: var(--button-medium-font-size);
|
|
244
|
-
padding: var(--button-medium-padding);
|
|
245
|
-
min-width: var(--button-medium-min-width);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.c1:hover {
|
|
249
|
-
box-shadow: var(--button-active-box-shadow);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.c1:active {
|
|
253
|
-
box-shadow: var(--button-active-box-shadow);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.c1:hover {
|
|
257
|
-
border: 2px solid var(--button-active-background-color);
|
|
258
|
-
background-color: transparent;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.c1:active {
|
|
262
|
-
border: 2px solid var(--button-outlined-active-border-color);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.c0 + .c0 {
|
|
266
|
-
margin-left: 0.85em;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
<button
|
|
270
|
-
class="c0 c1 button-color-default"
|
|
271
|
-
>
|
|
272
|
-
Test
|
|
273
|
-
</button>
|
|
274
|
-
`;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import { CodeBlock } from '@theme/CodeBlock';
|
|
5
|
-
|
|
6
|
-
describe('CodeBlock', () => {
|
|
7
|
-
it('renders', () => {
|
|
8
|
-
const { container } = render(<CodeBlock>Test</CodeBlock>);
|
|
9
|
-
|
|
10
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
11
|
-
});
|
|
12
|
-
});
|