mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-04 12:20:19 +03:00
chore: add supoort of styled components
This commit is contained in:
parent
46c70d7fd5
commit
0eb55aca61
3506
package-lock.json
generated
3506
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -79,7 +79,7 @@
|
||||||
"@types/react": "^17.0.8",
|
"@types/react": "^17.0.8",
|
||||||
"@types/react-dom": "^17.0.5",
|
"@types/react-dom": "^17.0.5",
|
||||||
"@types/react-tabs": "^2.3.2",
|
"@types/react-tabs": "^2.3.2",
|
||||||
"@types/styled-components": "^5.1.1",
|
"@types/styled-components": "^5.1.26",
|
||||||
"@types/tapable": "^2.2.2",
|
"@types/tapable": "^2.2.2",
|
||||||
"@types/webpack": "^5.28.0",
|
"@types/webpack": "^5.28.0",
|
||||||
"@types/webpack-env": "^1.18.0",
|
"@types/webpack-env": "^1.18.0",
|
||||||
|
@ -137,7 +137,7 @@
|
||||||
"mobx": "^6.0.4",
|
"mobx": "^6.0.4",
|
||||||
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
|
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
|
||||||
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0",
|
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0",
|
||||||
"styled-components": "^4.1.1 || ^5.1.1 || ^6.0.0"
|
"styled-components": "^4.1.1 || ^5.1.1 || ^6.0.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@redocly/openapi-core": "^1.0.0-beta.104",
|
"@redocly/openapi-core": "^1.0.0-beta.104",
|
||||||
|
|
|
@ -69,7 +69,9 @@ export const TypeTitle = styled(FieldLabel)`
|
||||||
|
|
||||||
export const TypeFormat = TypeName;
|
export const TypeFormat = TypeName;
|
||||||
|
|
||||||
export const RequiredLabel = styled(FieldLabel.withComponent('div'))`
|
export const RequiredLabel = styled(FieldLabel).attrs({
|
||||||
|
as: 'div',
|
||||||
|
})`
|
||||||
color: ${props => props.theme.schema.requireLabelColor};
|
color: ${props => props.theme.schema.requireLabelColor};
|
||||||
font-size: ${props => props.theme.schema.labelsTextSize};
|
font-size: ${props => props.theme.schema.labelsTextSize};
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
|
@ -32,7 +32,9 @@ export const SampleControlsWrap = styled.div`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const StyledPre = styled(PrismDiv.withComponent('pre'))`
|
export const StyledPre = styled(PrismDiv).attrs({
|
||||||
|
as: 'pre',
|
||||||
|
})`
|
||||||
font-family: ${props => props.theme.typography.code.fontFamily};
|
font-family: ${props => props.theme.typography.code.fontFamily};
|
||||||
font-size: ${props => props.theme.typography.code.fontSize};
|
font-size: ${props => props.theme.typography.code.fontSize};
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
|
|
@ -4,8 +4,11 @@ import * as React from 'react';
|
||||||
import { OptionsConsumer } from '../OptionsProvider';
|
import { OptionsConsumer } from '../OptionsProvider';
|
||||||
import { StylingMarkdownProps } from './Markdown';
|
import { StylingMarkdownProps } from './Markdown';
|
||||||
import { StyledMarkdownBlock } from './styled.elements';
|
import { StyledMarkdownBlock } from './styled.elements';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const StyledMarkdownSpan = StyledMarkdownBlock.withComponent('span');
|
const StyledMarkdownSpan = styled(StyledMarkdownBlock)`
|
||||||
|
display: inline;
|
||||||
|
`;
|
||||||
|
|
||||||
const sanitize = (untrustedSpec, html) => (untrustedSpec ? DOMPurify.sanitize(html) : html);
|
const sanitize = (untrustedSpec, html) => (untrustedSpec ? DOMPurify.sanitize(html) : html);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,9 @@ export const ResponseDetailsWrap = styled.div`
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const HeadersCaption = styled(UnderlinedHeader.withComponent('caption'))`
|
export const HeadersCaption = styled(UnderlinedHeader).attrs({
|
||||||
|
as: 'button',
|
||||||
|
})`
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
caption-side: top;
|
caption-side: top;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user