Skip to content

Commit ddc23ee

Browse files
committed
[Code]: remove manually created theme file to avoid type errors using new EUI
1 parent e7e4491 commit ddc23ee

File tree

24 files changed

+275
-289
lines changed

24 files changed

+275
-289
lines changed

x-pack/plugins/code/public/components/admin_page/admin.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { EuiTab, EuiTabs } from '@elastic/eui';
1212

1313
import styled from 'styled-components';
1414

15-
import { euiSizeXl } from '@elastic/eui/dist/eui_theme_light.json';
15+
import theme from '@elastic/eui/dist/eui_theme_light.json';
1616
import { parse as parseQuery } from 'querystring';
1717
import { RouteComponentProps, withRouter } from 'react-router-dom';
1818
import { Repository } from '../../../model';
@@ -22,7 +22,7 @@ import { LanguageSeverTab } from './language_server_tab';
2222
import { ProjectTab } from './project_tab';
2323

2424
const Container = styled.div`
25-
margin: 0 ${euiSizeXl};
25+
margin: 0 ${theme.euiSizeXl};
2626
flex-grow: 1;
2727
`;
2828

x-pack/plugins/code/public/components/admin_page/project_settings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
EuiText,
1818
EuiTitle,
1919
} from '@elastic/eui';
20-
import { euiSizeS } from '@elastic/eui/dist/eui_theme_light.json';
20+
import theme from '@elastic/eui/dist/eui_theme_light.json';
2121
import React, { ChangeEvent } from 'react';
2222
import { connect } from 'react-redux';
2323
import { Link } from 'react-router-dom';
@@ -32,7 +32,7 @@ import { JavaIcon, TypeScriptIcon } from '../shared/icons';
3232
const IconContainer = styled.div`
3333
display: inline-block;
3434
position: relative;
35-
top: ${euiSizeS};
35+
top: ${theme.euiSizeS};
3636
`;
3737

3838
const defaultConfig = {

x-pack/plugins/code/public/components/admin_page/setup_guide.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ import {
1313
EuiText,
1414
EuiTitle,
1515
} from '@elastic/eui';
16-
import { euiSizeL, euiSizeXxl } from '@elastic/eui/dist/eui_theme_light.json';
16+
import theme from '@elastic/eui/dist/eui_theme_light.json';
1717
import React from 'react';
1818
import { Link } from 'react-router-dom';
1919
import styled from 'styled-components';
2020

2121
const Root = styled.div`
22-
padding: ${euiSizeXxl} 0;
22+
padding: ${theme.euiSizeXxl} 0;
2323
margin: 0 auto;
2424
& > div {
25-
margin-top: ${euiSizeL};
25+
margin-top: ${theme.euiSizeL};
2626
width: 56rem;
2727
}
2828
`;

x-pack/plugins/code/public/components/codeblock/codeblock.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { EuiPanel, EuiText } from '@elastic/eui';
88
import { EuiSpacer } from '@elastic/eui';
9-
import { euiCodeBlockTagColor } from '@elastic/eui/dist/eui_theme_light.json';
9+
import theme from '@elastic/eui/dist/eui_theme_light.json';
1010
import { editor, IPosition, IRange } from 'monaco-editor';
1111
import React from 'react';
1212
import styled from 'styled-components';
@@ -15,7 +15,7 @@ import { monaco } from '../../monaco/monaco';
1515
import { registerEditor } from '../../monaco/single_selection_helper';
1616

1717
const U = styled.u`
18-
color: ${euiCodeBlockTagColor};
18+
color: ${theme.euiCodeBlockTagColor};
1919
`;
2020

2121
interface Props {

x-pack/plugins/code/public/components/diff_page/diff.tsx

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@
55
*/
66

77
import { EuiAccordion, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiTitle } from '@elastic/eui';
8-
import {
9-
euiBorderThick,
10-
euiBorderThin,
11-
euiColorDanger,
12-
euiColorPrimary,
13-
euiColorVis0,
14-
euiSize,
15-
euiSizeS,
16-
euiSizeXs,
17-
paddingSizes,
18-
} from '@elastic/eui/dist/eui_theme_light.json';
8+
import theme from '@elastic/eui/dist/eui_theme_light.json';
199
import React, { MouseEvent } from 'react';
2010
import { connect } from 'react-redux';
2111
import { Link, RouteComponentProps, withRouter } from 'react-router-dom';
@@ -35,56 +25,56 @@ const B = styled.b`
3525
`;
3626

3727
const PrimaryB = styled(B)`
38-
color: ${euiColorPrimary};
28+
color: ${theme.euiColorPrimary};
3929
`;
4030

4131
const CommitId = styled.span`
4232
display: inline-block;
43-
padding: 0 ${paddingSizes.xs};
44-
border: ${euiBorderThin};
33+
padding: 0 ${theme.paddingSizes.xs};
34+
border: ${theme.euiBorderThin};
4535
`;
4636

4737
const Addition = styled.div`
48-
padding: ${paddingSizes.xs} ${paddingSizes.s};
49-
border-radius: ${euiSizeXs};
38+
padding: ${theme.paddingSizes.xs} ${theme.paddingSizes.s};
39+
border-radius: ${theme.euiSizeXs};
5040
color: white;
51-
margin-right: ${euiSizeS};
52-
background-color: ${euiColorDanger};
41+
margin-right: ${theme.euiSizeS};
42+
background-color: ${theme.euiColorDanger};
5343
`;
5444

5545
const Deletion = styled(Addition)`
56-
background-color: ${euiColorVis0};
46+
background-color: ${theme.euiColorVis0};
5747
`;
5848

5949
const Container = styled.div`
60-
padding: ${paddingSizes.xs} ${paddingSizes.m};
50+
padding: ${theme.paddingSizes.xs} ${theme.paddingSizes.m};
6151
`;
6252

6353
const TopBarContainer = styled.div`
6454
height: calc(48rem / 14);
65-
border-bottom: ${euiBorderThin};
66-
padding: 0 ${paddingSizes.m};
55+
border-bottom: ${theme.euiBorderThin};
56+
padding: 0 ${theme.paddingSizes.m};
6757
display: flex;
6858
flex-direction: row;
6959
justify-content: space-between;
7060
`;
7161

7262
const Accordion = styled(EuiAccordion)`
73-
border: ${euiBorderThick};
74-
border-radius: ${euiSizeS};
75-
margin-bottom: ${euiSize};
63+
border: ${theme.euiBorderThick};
64+
border-radius: ${theme.euiSizeS};
65+
margin-bottom: ${theme.euiSize};
7666
`;
7767

7868
const Icon = styled(EuiIcon)`
79-
margin-right: ${euiSizeS};
69+
margin-right: ${theme.euiSizeS};
8070
`;
8171

8272
const Parents = styled.div`
83-
border-left: ${euiBorderThin};
73+
border-left: ${theme.euiBorderThin};
8474
height: calc(32rem / 14);
8575
line-height: calc(32rem / 14);
86-
padding-left: ${paddingSizes.s};
87-
margin: ${euiSizeS} 0;
76+
padding-left: ${theme.paddingSizes.s};
77+
margin: ${theme.euiSizeS} 0;
8878
`;
8979

9080
const H4 = styled.h4`

x-pack/plugins/code/public/components/file_tree/file_tree.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React from 'react';
88
import { EuiIcon, EuiSideNav } from '@elastic/eui';
99
import classes from 'classnames';
1010

11-
import { euiSizeXs } from '@elastic/eui/dist/eui_theme_light.json';
11+
import theme from '@elastic/eui/dist/eui_theme_light.json';
1212
import { connect } from 'react-redux';
1313
import { RouteComponentProps, withRouter } from 'react-router-dom';
1414
import styled from 'styled-components';
@@ -19,7 +19,7 @@ import { RootState } from '../../reducers';
1919
import { FolderClosedTriangle, FolderOpenTriangle } from '../shared';
2020

2121
const DirectoryNode = styled.span`
22-
margin-left: ${euiSizeXs};
22+
margin-left: ${theme.euiSizeXs};
2323
vertical-align: middle;
2424
`;
2525

x-pack/plugins/code/public/components/hover/hover_widget.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { EuiText } from '@elastic/eui';
8-
import { euiFontSizeXs } from '@elastic/eui/dist/eui_theme_light.json';
8+
import theme from '@elastic/eui/dist/eui_theme_light.json';
99
// @ts-ignore
1010
import { renderMarkdown } from 'monaco-editor/esm/vs/base/browser/htmlContentRenderer';
1111
// @ts-ignore
@@ -17,7 +17,7 @@ import { MarkedString } from 'vscode-languageserver-types';
1717
const Text = styled(EuiText)`
1818
p {
1919
color: #8c8c8c;
20-
font-size: ${euiFontSizeXs};
20+
font-size: ${theme.euiFontSizeXs};
2121
}
2222
`;
2323

x-pack/plugins/code/public/components/main/blame.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { EuiAvatar, EuiFlexGroup, EuiFlexItem, EuiText, EuiTextColor } from '@elastic/eui';
8-
import { euiBorderThick, euiSizeS, paddingSizes } from '@elastic/eui/dist/eui_theme_light.json';
8+
import theme from '@elastic/eui/dist/eui_theme_light.json';
99
import _ from 'lodash';
1010
import moment from 'moment';
1111
import React from 'react';
@@ -20,12 +20,12 @@ const BlameMessage = styled(EuiText)`
2020
`;
2121

2222
const Avatar = styled(EuiAvatar)`
23-
margin: auto ${euiSizeS} auto 0;
23+
margin: auto ${theme.euiSizeS} auto 0;
2424
`;
2525

2626
const Root = styled(EuiFlexGroup)<{ isFirstLine: boolean }>`
27-
padding: ${paddingSizes.xs} ${paddingSizes.s};
28-
border-top: ${props => (props.isFirstLine ? 'none' : euiBorderThick)};
27+
padding: ${theme.paddingSizes.xs} ${theme.paddingSizes.s};
28+
border-top: ${props => (props.isFirstLine ? 'none' : theme.euiBorderThick)};
2929
`;
3030

3131
export class Blame extends React.PureComponent<{ blame: GitBlame; isFirstLine: boolean }> {

x-pack/plugins/code/public/components/main/clone_status.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,20 @@
55
*/
66

77
import { EuiFlexGroup, EuiFlexItem, EuiProgress, EuiSpacer, EuiText } from '@elastic/eui';
8-
import {
9-
euiBorderThin,
10-
euiSizeM,
11-
euiSizeXxl,
12-
paddingSizes,
13-
} from '@elastic/eui/dist/eui_theme_light.json';
8+
import theme from '@elastic/eui/dist/eui_theme_light.json';
149
import React from 'react';
1510
import styled from 'styled-components';
1611
import { CloneProgress } from '../../../model';
1712

1813
export const TextProgress = styled.div`
19-
font-size: ${euiSizeM};
14+
font-size: ${theme.euiSizeM};
2015
color: #98a2b3;
2116
`;
2217

2318
export const ProgressContainer = styled.div`
2419
width: 40rem;
25-
padding: ${paddingSizes.xs};
26-
border: ${euiBorderThin};
20+
padding: ${theme.paddingSizes.xs};
21+
border: ${theme.euiBorderThin};
2722
`;
2823

2924
interface Props {
@@ -55,11 +50,13 @@ export const CloneStatus = (props: Props) => {
5550
<EuiSpacer size="xxl" />
5651
<EuiSpacer size="xxl" />
5752
<EuiFlexItem grow={false}>
58-
<EuiText style={{ fontSize: euiSizeXxl, color: '#1A1A1A' }}>{repoName} is cloning</EuiText>
53+
<EuiText style={{ fontSize: theme.euiSizeXxl, color: '#1A1A1A' }}>
54+
{repoName} is cloning
55+
</EuiText>
5956
</EuiFlexItem>
6057
<EuiSpacer size="s" />
6158
<EuiFlexItem grow={false}>
62-
<EuiText style={{ fontSize: euiSizeM, color: '#69707D' }}>
59+
<EuiText style={{ fontSize: theme.euiSizeM, color: '#69707D' }}>
6360
Your project will be available when this process is complete
6461
</EuiText>
6562
</EuiFlexItem>

x-pack/plugins/code/public/components/main/commit_history.tsx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@ import {
1212
EuiText,
1313
EuiTextColor,
1414
} from '@elastic/eui';
15-
import {
16-
euiBorderColor,
17-
euiBorderThick,
18-
euiBorderThin,
19-
euiSizeM,
20-
euiSizeS,
21-
euiSizeXs,
22-
paddingSizes,
23-
} from '@elastic/eui/dist/eui_theme_light.json';
15+
import theme from '@elastic/eui/dist/eui_theme_light.json';
2416
import _ from 'lodash';
2517
import moment from 'moment';
2618
import React from 'react';
@@ -31,18 +23,18 @@ import { CommitLink } from '../diff_page/commit_link';
3123
const COMMIT_ID_LENGTH = 8;
3224

3325
const Dot = styled.div`
34-
--dotRadius: ${euiSizeS};
26+
--dotRadius: ${theme.euiSizeS};
3527
width: var(--dotRadius);
3628
height: var(--dotRadius);
3729
border-radius: calc(var(--dotRadius) / 2);
38-
background-color: ${euiBorderColor};
30+
background-color: ${theme.euiBorderColor};
3931
margin: auto;
4032
`;
4133

4234
const CommitMessages = styled.div`
4335
overflow: auto;
4436
flex: 1;
45-
padding: ${paddingSizes.m};
37+
padding: ${theme.paddingSizes.m};
4638
`;
4739

4840
const Header = styled.div`
@@ -52,9 +44,9 @@ const Header = styled.div`
5244
`;
5345

5446
const TimeLine = styled.div`
55-
border-left: ${euiBorderThick};
56-
margin-left: ${euiSizeXs};
57-
padding: ${paddingSizes.s} 0 ${paddingSizes.s} ${paddingSizes.m};
47+
border-left: ${theme.euiBorderThick};
48+
margin-left: ${theme.euiSizeXs};
49+
padding: ${theme.paddingSizes.s} 0 ${theme.paddingSizes.s} ${theme.paddingSizes.m};
5850
`;
5951

6052
const CommitRoot = styled(EuiPanel)`
@@ -67,7 +59,7 @@ const CommitRoot = styled(EuiPanel)`
6759
`;
6860

6961
const CommitGroupContainer = styled.div`
70-
margin: 0 0 ${euiSizeXs} ${euiSizeM};
62+
margin: 0 0 ${theme.euiSizeXs} ${theme.euiSizeM};
7163
`;
7264

7365
const CommitId = styled.div`
@@ -77,7 +69,7 @@ const CommitId = styled.div`
7769
margin: auto 0;
7870
line-height: var(--height);
7971
color: black;
80-
border: ${euiBorderThin};
72+
border: ${theme.euiBorderThin};
8173
text-align: center;
8274
flex-shrink: 0;
8375
`;

0 commit comments

Comments
 (0)