diff --git a/x-pack/plugins/code/public/components/diff_page/commit_link.tsx b/x-pack/plugins/code/public/components/diff_page/commit_link.tsx
index 5d066f0c3fbd8..7525dfe6c4884 100644
--- a/x-pack/plugins/code/public/components/diff_page/commit_link.tsx
+++ b/x-pack/plugins/code/public/components/diff_page/commit_link.tsx
@@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-import { EuiLink } from '@elastic/eui';
+import { EuiBadge, EuiLink } from '@elastic/eui';
import React from 'react';
import { DIFF } from '../routes';
@@ -15,5 +15,9 @@ interface Props {
export const CommitLink = ({ repoUri, commit, children }: Props) => {
const href = DIFF.replace(':resource/:org/:repo', repoUri).replace(':commitId', commit);
- return {children || commit};
+ return (
+
+ {children || commit}
+
+ );
};
diff --git a/x-pack/plugins/code/public/components/file_tree/__snapshots__/file_tree.test.tsx.snap b/x-pack/plugins/code/public/components/file_tree/__snapshots__/file_tree.test.tsx.snap
index 56e6b9a19faea..d9be6ed95d17f 100644
--- a/x-pack/plugins/code/public/components/file_tree/__snapshots__/file_tree.test.tsx.snap
+++ b/x-pack/plugins/code/public/components/file_tree/__snapshots__/file_tree.test.tsx.snap
@@ -80,12 +80,31 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- android/
+
+ android/
+
@@ -113,12 +136,31 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- futures/
+
+ futures/
+
@@ -146,12 +192,30 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- guava/
+
+ guava/
+
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- javadoc-link/
+
+ javadoc-link/
+
@@ -215,7 +306,7 @@ exports[`render correctly 1`] = `
role="button"
>
- pom.xml
+
+ pom.xml
+
@@ -250,12 +345,30 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- src/com/google/
+
+ src/com/google/
+
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- common/
+
+ common/
+
@@ -318,12 +458,31 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- thirdparty/
+
+ thirdparty/
+
@@ -355,12 +518,31 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- guava-bom/
+
+ guava-bom/
+
@@ -388,12 +574,31 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- guava-gwt/
+
+ guava-gwt/
+
@@ -421,12 +630,31 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- guava-testlib/
+
+ guava-testlib/
+
@@ -454,12 +686,31 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- guava-tests/
+
+ guava-tests/
+
@@ -487,12 +742,31 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- refactorings/
+
+ refactorings/
+
@@ -520,12 +798,31 @@ exports[`render correctly 1`] = `
onClick={[Function]}
role="button"
>
-
+ style={null}
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+
+
+
+
+
- util/
+
+ util/
+
@@ -554,7 +855,7 @@ exports[`render correctly 1`] = `
role="button"
>
- .gitattributes
+
+ .gitattributes
+
@@ -590,7 +895,7 @@ exports[`render correctly 1`] = `
role="button"
>
- .gitignore
+
+ .gitignore
+
@@ -626,7 +935,7 @@ exports[`render correctly 1`] = `
role="button"
>
- .travis.yml
+
+ .travis.yml
+
@@ -662,7 +975,7 @@ exports[`render correctly 1`] = `
role="button"
>
- CONTRIBUTING.md
+
+ CONTRIBUTING.md
+
@@ -698,7 +1015,7 @@ exports[`render correctly 1`] = `
role="button"
>
- CONTRIBUTORS
+
+ CONTRIBUTORS
+
@@ -734,7 +1055,7 @@ exports[`render correctly 1`] = `
role="button"
>
- COPYING
+
+ COPYING
+
@@ -770,7 +1095,7 @@ exports[`render correctly 1`] = `
role="button"
>
- README.md
+
+ README.md
+
@@ -806,7 +1135,7 @@ exports[`render correctly 1`] = `
role="button"
>
- cycle_whitelist.txt
+
+ cycle_whitelist.txt
+
@@ -842,7 +1175,7 @@ exports[`render correctly 1`] = `
role="button"
>
- javadoc-stylesheet.css
+
+ javadoc-stylesheet.css
+
@@ -878,7 +1215,7 @@ exports[`render correctly 1`] = `
role="button"
>
- pom.xml
+
+ pom.xml
+
diff --git a/x-pack/plugins/code/public/components/file_tree/file_tree.tsx b/x-pack/plugins/code/public/components/file_tree/file_tree.tsx
index 29cac5a87b73e..a0b02107d358e 100644
--- a/x-pack/plugins/code/public/components/file_tree/file_tree.tsx
+++ b/x-pack/plugins/code/public/components/file_tree/file_tree.tsx
@@ -5,7 +5,7 @@
*/
import React from 'react';
-import { EuiIcon, EuiSideNav } from '@elastic/eui';
+import { EuiIcon, EuiSideNav, EuiText } from '@elastic/eui';
import classes from 'classnames';
import theme from '@elastic/eui/dist/eui_theme_light.json';
@@ -16,7 +16,6 @@ import { FileTree as Tree, FileTreeItemType } from '../../../model';
import { closeTreePath, fetchRepoTree, FetchRepoTreePayload } from '../../actions';
import { EuiSideNavItem, MainRouteParams, PathTypes } from '../../common/types';
import { RootState } from '../../reducers';
-import { FolderClosedTriangle, FolderOpenTriangle } from '../shared';
const DirectoryNode = styled.span`
margin-left: ${theme.euiSizeXs};
@@ -93,12 +92,28 @@ export class CodeFileTree extends React.Component {
onClick={onClick}
>
{forceOpen ? (
-
+
) : (
-
+
)}
-
- {`${node.name}/`}
+
+
+
+ {`${node.name}/`}
+
+
);
}
@@ -110,8 +125,12 @@ export class CodeFileTree extends React.Component {
className={classes(className, 'code-file-tree-file')}
role="button"
>
-
- {node.name}
+
+
+
+ {node.name}
+
+
);
}
@@ -123,8 +142,12 @@ export class CodeFileTree extends React.Component {
className={classes(className, 'code-file-tree-file')}
role="button"
>
-
- {node.name}
+
+
+
+ {node.name}
+
+
);
}
@@ -136,8 +159,12 @@ export class CodeFileTree extends React.Component {
className={classes(className, 'code-file-tree-file')}
role="button"
>
-
- {node.name}
+
+
+
+ {node.name}
+
+
);
}
diff --git a/x-pack/plugins/code/public/components/main/commit_history.tsx b/x-pack/plugins/code/public/components/main/commit_history.tsx
index c128dd626926e..a282f72c1d737 100644
--- a/x-pack/plugins/code/public/components/main/commit_history.tsx
+++ b/x-pack/plugins/code/public/components/main/commit_history.tsx
@@ -22,15 +22,6 @@ import { CommitLink } from '../diff_page/commit_link';
const COMMIT_ID_LENGTH = 8;
-const Dot = styled.div`
- --dotRadius: ${theme.euiSizeS};
- width: var(--dotRadius);
- height: var(--dotRadius);
- border-radius: calc(var(--dotRadius) / 2);
- background-color: ${theme.euiBorderColor};
- margin: auto;
-`;
-
const CommitMessages = styled.div`
overflow: auto;
flex: 1;
@@ -43,33 +34,9 @@ const Header = styled.div`
justify-content: space-between;
`;
-const TimeLine = styled.div`
- border-left: ${theme.euiBorderThick};
- margin-left: ${theme.euiSizeXs};
- padding: ${theme.paddingSizes.s} 0 ${theme.paddingSizes.s} ${theme.paddingSizes.m};
-`;
-
-const CommitRoot = styled(EuiPanel)`
- &:not(:first-child) {
- border-top: none;
- }
- display: flex;
- flex-direction: row;
- justify-content: space-between;
-`;
-
-const CommitGroupContainer = styled.div`
- margin: 0 0 ${theme.euiSizeXs} ${theme.euiSizeM};
-`;
-
const CommitId = styled.div`
- --height: calc(20rem / 14);
- width: var(--dotRadius);
- height: var(--height);
+ height: calc(20rem / 14);
margin: auto 0;
- line-height: var(--height);
- color: black;
- border: ${theme.euiBorderThin};
text-align: center;
flex-shrink: 0;
`;
@@ -84,12 +51,12 @@ const Commit = (props: { commit: CommitInfo; date: string; repoUri: string }) =>
.slice(0, COMMIT_ID_LENGTH)
.join('');
return (
-
+
-
+
{message}
-
+
{committer} · {date}
@@ -98,7 +65,7 @@ const Commit = (props: { commit: CommitInfo; date: string; repoUri: string }) =>
-
+
);
};
@@ -107,10 +74,10 @@ const CommitGroup = (props: { commits: CommitInfo[]; date: string; repoUri: stri
));
return (
-
+
-
+
@@ -120,8 +87,8 @@ const CommitGroup = (props: { commits: CommitInfo[]; date: string; repoUri: stri
-
{commitList}
-
+
{commitList}
+
);
};
diff --git a/x-pack/plugins/code/public/components/main/directory.tsx b/x-pack/plugins/code/public/components/main/directory.tsx
index 15d4165f871d5..1ff99fbc2281b 100644
--- a/x-pack/plugins/code/public/components/main/directory.tsx
+++ b/x-pack/plugins/code/public/components/main/directory.tsx
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { EuiIcon, EuiTitle, IconType } from '@elastic/eui';
+import { EuiIcon, EuiText, EuiTitle, IconType } from '@elastic/eui';
import theme from '@elastic/eui/dist/eui_theme_light.json';
import React from 'react';
import { Link, RouteComponentProps, withRouter } from 'react-router-dom';
@@ -46,15 +46,6 @@ const Container = styled.div`
}
`;
-const DirectoryNode = styled.div`
- width: calc(200rem / 14);
- margin: 0 ${theme.euiSizeS} ${theme.euiSizeM};
- :hover {
- background-color: ${theme.euiColorHighlight};
- cursor: pointer;
- }
-`;
-
interface DirectoryNodesProps {
title: string;
nodes: FileTree[];
@@ -69,17 +60,21 @@ const DirectoryNodes = (props: DirectoryNodesProps) => {
[FileTreeItemType.Submodule]: 'submodule',
};
const nodes = props.nodes.map(n => (
-
-
-
- {n.name}
-
-
+
+
+
+
+
+ {n.name}
+
+
+
+
));
return (
diff --git a/x-pack/plugins/code/public/components/main/main.scss b/x-pack/plugins/code/public/components/main/main.scss
index a203ab80d4d9b..fba10d0029b0e 100644
--- a/x-pack/plugins/code/public/components/main/main.scss
+++ b/x-pack/plugins/code/public/components/main/main.scss
@@ -25,6 +25,212 @@
margin: auto;
}
+.code-navigation__sidebar {
+ width: calc(256rem / 14);
+ border-right: $euiBorderThin;
+ display: flex;
+ flex-direction: column;
+ & > div {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ & > div:first-child {
+ flex-shrink: 0;
+ flex-grow: 0;
+ }
+ & > div:not(:first-child) {
+ display: flex;
+ flex-direction: column;
+ flex-grow: 1;
+ flex-shrink: 1;
+ }
+ }
+}
+
+.codeFileTree--container {
+ flex-grow: 1;
+ flex-shrink: 1;
+ overflow: auto;
+ padding: $euiSizeM;
+ background-color: $euiColorLightestShade;
+}
+
+.codeFileTree--icon {
+ margin-right: $euiSizeS;
+}
+
+.code-directory__node {
+ width: calc(200rem / 14);
+ margin: 0 $euiSizeXS $euiSizeS;
+ padding: $euiSizeXS;
+ border-radius: $euiBorderRadius;
+ a {
+ color: $euiColorDarkestShade;
+ }
+ &:hover {
+ background-color: rgba($euiColorGhost, .10);
+ cursor: pointer;
+ }
+}
+.code-timeline {
+ border-left: $euiBorderThick;
+ margin-left: $euiSizeXS;
+ padding: $euiSizeS 0 $euiSizeS $euiSizeS;
+}
+
+.code-timeline__marker {
+ width: $euiSizeS;
+ height: $euiSizeS;
+ border-radius: $euiSizeS / 2;
+ background-color: $euiBorderColor;
+ margin: auto;
+}
+
+.code-timeline__commit-container {
+ margin: 0 0 $euiSizeXS $euiSizeM;
+ .euiPanel:not(:first-of-type), .euiPanel:not(:last-of-type) {
+ border-radius: 0;
+ }
+}
+
+.euiPanel.code-timeline__commit--root {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ &:not(:first-child) {
+ border-top: none;
+ }
+ &:not(:first-child):not(:last-child) {
+ border-radius: 0;
+ }
+ &:first-child {
+ border-radius: $euiSizeXS $euiSizeXS 0 0;
+ }
+ &:last-child {
+ border-radius: 0 0 $euiSizeXS $euiSizeXS;
+ }
+ &:only-child{
+ border-radius: $euiSizeXS
+ }
+}
+
+.code-top-bar__container {
+ box-sizing: content-box;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ padding: $euiSizeS;
+ min-height: 80px;
+ border-bottom: $euiBorderThin;
+ nav {
+ a {
+ display: inline;
+ }
+ div {
+ vertical-align: baseline;
+ }
+ }
+}
+
+.codeSearch__suggestion-item {
+ background: $euiColorLightestShade;
+ height: 3rem;
+ margin: 0 $euiSize;
+ border-radius: $euiSizeXS;
+ cursor: pointer;
+ width: calc(100% - $euiSizeXL);
+
+ &:hover {
+ background: $euiColorLightShade;
+ }
+}
+
+.codeSearch__suggestion--active {
+ background: $euiColorLightShade;
+}
+
+.codeSearch-suggestion--inner {
+ display: flex;
+ align-items: stretch;
+ flex-grow: 1;
+ align-items: center;
+ white-space: nowrap;
+}
+
+.codeSearch__suggestion-text {
+ color: $euiColorFullShade;
+ display: flex;
+ flex-direction: column;
+ flex-grow: 0;
+ flex-basis: auto;
+ font-family: $euiCodeFontFamily;
+ margin-right: $euiSizeXL;
+ width: auto;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ padding: $euiSizeXS $euiSizeS;
+ font-size: $euiFontSizeS;
+}
+
+.codeSearch__full-text-button {
+ border-top: $euiBorderWidthThin solid $euiBorderColor;
+ padding: $euiSizeS;
+ text-align: center;
+ font-weight: bold;
+ background: $euiColorLightShade;
+ margin: $euiSizeS;
+ padding: $euiSizeS;
+ font-size: $euiFontSizeS;
+}
+
+.kbnTypeahead .kbnTypeahead__popover .kbnTypeahead__items {
+ overflow-x: hidden;
+}
+
+.codeSearch-suggestion__group-header {
+ padding: $euiSizeL;
+ border-top: $euiBorderThin;
+}
+.codeSearch-suggestion__group-title {
+ margin-left: $euiSizeS;
+ display: inline-block;
+}
+
+.codeSearch-suggestion__link {
+ height: $euiSize;
+ line-height: $euiSize;
+ text-align: center;
+ font-size: $euiFontSizeXS;
+ margin: $euiSizeS;
+}
+
+.codeSearch-suggestion__description {
+ flex-grow: 1;
+ flex-basis: 0%;
+ display: flex;
+ flex-direction: column;
+ color: $euiColorDarkShade;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ font-size: $euiFontSizeXS;
+ padding: $euiSizeXS $euiSize;
+}
+
+.codeSearch-suggestion__token {
+ color: $euiColorFullShade;
+ box-sizing: border-box;
+ flex-grow: 0;
+ flex-basis: auto;
+ width: $euiSizeXL;
+ height: $euiSizeXL;
+ text-align: center;
+ overflow: hidden;
+ padding: $euiSizeXS;
+ justify-content: center;
+ align-items: center;
+ margin-left: $euiSizeXS;
+}
+
.code-link {
&:focus {
box-shadow: none;
diff --git a/x-pack/plugins/code/public/components/main/side_tabs.tsx b/x-pack/plugins/code/public/components/main/side_tabs.tsx
index 0b2793ba7e9b8..dae3a1f0ce532 100644
--- a/x-pack/plugins/code/public/components/main/side_tabs.tsx
+++ b/x-pack/plugins/code/public/components/main/side_tabs.tsx
@@ -5,11 +5,9 @@
*/
import { EuiTabbedContent } from '@elastic/eui';
-import theme from '@elastic/eui/dist/eui_theme_light.json';
import { parse as parseQuery } from 'querystring';
import React from 'react';
import { RouteComponentProps, withRouter } from 'react-router-dom';
-import styled from 'styled-components';
import { QueryString } from 'ui/utils/query_string';
import { MainRouteParams, PathTypes } from '../../common/types';
import { FileTree } from '../file_tree/file_tree';
@@ -21,38 +19,6 @@ enum Tabs {
structure = 'structure',
}
-const Container = styled.div`
- width: calc(256rem / 14);
- border-right: ${theme.euiBorderThin};
- display: flex;
- flex-grow: 0;
- flex-shrink: 0;
- flex-direction: column;
- & > div {
- height: 100%;
- display: flex;
- flex-direction: column;
- & > div:first-child {
- flex-shrink: 0;
- flex-grow: 0;
- }
- & > div:not(:first-child) {
- display: flex;
- flex-direction: column;
- flex-grow: 1;
- flex-shrink: 1;
- }
- }
-`;
-
-const FileTreeContainer = styled.div`
- flex-grow: 1;
- flex-shrink: 1;
- overflow: auto;
- padding: ${theme.paddingSizes.l} ${theme.paddingSizes.m};
- background-color: ${theme.euiColorLightestShade};
-`;
-
class CodeSideTabs extends React.PureComponent> {
public get sideTab(): Tabs {
const { search } = this.props.location;
@@ -70,9 +36,9 @@ class CodeSideTabs extends React.PureComponent
+
-
+
),
isSelected: Tabs.file === this.sideTab,
'data-test-subj': 'codeFileTreeTab',
@@ -97,7 +63,7 @@ class CodeSideTabs extends React.PureComponent
+
t.id === this.sideTab)}
@@ -109,7 +75,7 @@ class CodeSideTabs extends React.PureComponent
-
+
);
}
private toggleTab = () => {
diff --git a/x-pack/plugins/code/public/components/main/top_bar.tsx b/x-pack/plugins/code/public/components/main/top_bar.tsx
index 4c1afcdcfd50f..9857b0c30df8f 100644
--- a/x-pack/plugins/code/public/components/main/top_bar.tsx
+++ b/x-pack/plugins/code/public/components/main/top_bar.tsx
@@ -5,32 +5,12 @@
*/
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
-import theme from '@elastic/eui/dist/eui_theme_light.json';
import React from 'react';
-import styled from 'styled-components';
import { SearchScope } from '../../../model';
import { MainRouteParams } from '../../common/types';
import { Breadcrumb } from './breadcrumb';
import { SearchBar } from './search_bar';
-const TopBarContainer = styled.div`
- box-sizing: content-box;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- padding: ${theme.paddingSizes.s};
- min-height: 80px;
- border-bottom: ${theme.euiBorderThick};
- nav {
- a {
- display: inline;
- }
- div {
- vertical-align: baseline;
- }
- }
-`;
-
interface Props {
routeParams: MainRouteParams;
onSearchScopeChanged: (s: SearchScope) => void;
@@ -41,18 +21,20 @@ interface Props {
export class TopBar extends React.Component {
public render() {
return (
-
+
-
+
- {this.props.buttons}
+
+ {this.props.buttons}
+
-
+
);
}
}
diff --git a/x-pack/plugins/code/public/components/query_bar/components/typeahead/__snapshots__/suggestion_component.test.tsx.snap b/x-pack/plugins/code/public/components/query_bar/components/typeahead/__snapshots__/suggestion_component.test.tsx.snap
index cd572cc0523dc..8e783dd8e806c 100644
--- a/x-pack/plugins/code/public/components/query_bar/components/typeahead/__snapshots__/suggestion_component.test.tsx.snap
+++ b/x-pack/plugins/code/public/components/query_bar/components/typeahead/__snapshots__/suggestion_component.test.tsx.snap
@@ -19,64 +19,38 @@ exports[`render file item 1`] = `
}
}
>
-
-
+
-
-
-
-
-
- src/foo/
-
- bar
-
- .java
-
-
-
-
-
-
-
- This is a file
-
-
-
-
+
+ src/foo/
+
+ bar
+
+ .java
+
-
+
+ This is a file
+
+
-
+
`;
@@ -99,61 +73,35 @@ exports[`render repository item 1`] = `
}
}
>
-
-
+
-
-
-
-
-
- elastic/
-
- kibana
-
-
-
-
-
-
-
-
-
-
-
+
+ elastic/
+
+ kibana
+
+
-
+
+
-
+
`;
@@ -176,111 +124,79 @@ exports[`render symbol item 1`] = `
}
}
>
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
- java.lang.
-
- String
-
-
-
-
-
-
-
-
- elastic/elasticsearch > src/foo/bar.java
-
-
-
+
+
+
+
+
+
+
+
+
+ java.lang.
+
+ String
+
+
+
+
+ elastic/elasticsearch > src/foo/bar.java
-
+
-
+
`;
diff --git a/x-pack/plugins/code/public/components/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap b/x-pack/plugins/code/public/components/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap
index 19067e797b837..a013a9cbdbc4a 100644
--- a/x-pack/plugins/code/public/components/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap
+++ b/x-pack/plugins/code/public/components/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap
@@ -139,13 +139,30 @@ exports[`render full suggestions component 1`] = `
onScroll={[Function]}
role="listbox"
>
-
+
-
+
-
-
+
Symbols
-
-
-
-
-
-
- 1
- Result
+
+
-
+
+
+ 1
+ Result
+
-
+
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
- java.lang.
-
- String
-
-
-
-
-
-
-
-
- elastic/elasticsearch > src/foo/bar.java
-
-
-
+
+
+
+
+
+
+
+
+
+ java.lang.
+
+ String
+
+
+
+
+ elastic/elasticsearch > src/foo/bar.java
-
+
-
+
-
+
-
+
-
-
+
Files
-
-
-
-
-
-
- 1
- Result
+
+
-
+
+
+ 1
+ Result
+
-
+
-
-
+
-
-
-
-
- src/foo/bar.java
-
-
-
-
-
-
- This is a file
-
-
-
-
+ src/foo/bar.java
+
+
+ This is a file
-
+
-
+
-
+
-
+
-
-
+
Repos
-
-
-
-
-
-
- 2
- Result
- s
+
+
-
+
+
+ 2
+ Result
+ s
+
-
+
-
-
+
-
-
-
-
- elastic/kibana
-
-
-
-
-
-
-
-
-
+ elastic/kibana
-
+
+
-
+
-
-
+
-
-
-
-
- elastic/elasticsearch
-
-
-
-
-
-
-
-
-
+ elastic/elasticsearch
-
+
+
-
-
-
-
-
-
-
+
-
+
+
+ Press ⮐ Return for Full Text Search
+
diff --git a/x-pack/plugins/code/public/components/query_bar/components/typeahead/suggestion_component.tsx b/x-pack/plugins/code/public/components/query_bar/components/typeahead/suggestion_component.tsx
index 4af9d750a0865..89befae7cbf07 100644
--- a/x-pack/plugins/code/public/components/query_bar/components/typeahead/suggestion_component.tsx
+++ b/x-pack/plugins/code/public/components/query_bar/components/typeahead/suggestion_component.tsx
@@ -5,10 +5,7 @@
*/
import { EuiToken, IconType } from '@elastic/eui';
-import theme from '@elastic/eui/dist/eui_theme_light.json';
import React, { SFC } from 'react';
-import styled from 'styled-components';
-
import { AutocompleteSuggestion } from '../..';
interface Props {
@@ -21,64 +18,6 @@ interface Props {
ariaId: string;
}
-const SuggestionItem = styled.div`
- background: ${(props: any) => (props.active ? theme.euiColorHighlight : 'white')};
- height: calc(48rem / 14);
- margin: 0 ${theme.euiSize};
- border-radius: ${theme.euiSizeXs} ${theme.euiSizeXs} ${theme.euiSizeXs} ${theme.euiSizeXs};
- cursor: pointer;
-`;
-
-const SuggestionItemInner = styled.div`
- display: flex;
- align-items: stretch;
- flex-grow: 1;
- align-items: center;
- white-space: nowrap;
-`;
-
-const SuggestionItemBase = styled.div`
- flex-grow: 1;
- flex-basis: 0%;
- display: flex;
- flex-direction: column;
-`;
-
-const SuggestionItemToken = styled(SuggestionItemBase)`
- color: ${theme.euiColorFullShade};
- flex-grow: 0;
- flex-basis: auto;
- width: ${theme.euiSizeXl};
- height: ${theme.euiSizeXl};
- text-align: center;
- overflow: hidden;
- padding: ${theme.euiSizeXs};
- justify-content: center;
- align-items: center;
-`;
-
-const SuggestionItemText = styled(SuggestionItemBase)`
- color: ${theme.euiColorFullShade};
- flex-grow: 0;
- flex-basis: auto;
- font-family: ${theme.euiCodeFontFamily};
- margin-right: ${theme.euiSizeXl};
- width: auto;
- overflow: hidden;
- text-overflow: ellipsis;
- padding: ${theme.euiSizeXs} ${theme.euiSizeS};
- color: #111;
- font-size: ${theme.euiFontSizeS};
-`;
-
-const SuggestionItemDescription = styled(SuggestionItemBase)`
- color: ${theme.euiColorDarkShade};
- overflow: hidden;
- text-overflow: ellipsis;
- font-size: ${theme.euiFontSizeXs};
- padding: ${theme.euiSizeXs} ${theme.euiSizeS};
-`;
-
export const SuggestionComponent: SFC = props => {
const click = () => props.onClick(props.suggestion);
@@ -107,31 +46,35 @@ export const SuggestionComponent: SFC = props => {
};
const icon = props.suggestion.tokenType ? (
-
+
-
+
) : null;
return (
-
-
+
{icon}
-
+
{renderMatchingText(props.suggestion.text)}
-
- {props.suggestion.description}
+
+ {props.suggestion.description}
-
-
+
+
);
};
diff --git a/x-pack/plugins/code/public/components/query_bar/components/typeahead/suggestions_component.tsx b/x-pack/plugins/code/public/components/query_bar/components/typeahead/suggestions_component.tsx
index b78287e5d2cec..f09bfab62494f 100644
--- a/x-pack/plugins/code/public/components/query_bar/components/typeahead/suggestions_component.tsx
+++ b/x-pack/plugins/code/public/components/query_bar/components/typeahead/suggestions_component.tsx
@@ -4,12 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { EuiToken, IconType } from '@elastic/eui';
-import theme from '@elastic/eui/dist/eui_theme_light.json';
+import { EuiFlexGroup, EuiText, EuiToken, IconType } from '@elastic/eui';
import { isEmpty } from 'lodash';
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
-import styled from 'styled-components';
import Url from 'url';
import {
@@ -30,46 +28,6 @@ interface Props {
loadMore: () => void;
}
-const SuggestionGroupHeader = styled.div`
- border-top: ${theme.euiBorderWidthThin} solid ${theme.euiBorderColor};
- display: flex;
- justify-content: space-between;
- padding: ${theme.euiSize};
-`;
-
-const SuggestionGroupHeaderTitle = styled.div`
- display: flex;
-`;
-
-const SuggestionGroupHeaderTitleText = styled.span`
- margin-left: ${theme.euiSizeS};
-`;
-
-const SuggestionGroupHeaderResult = styled.div`
- color: ${theme.euiColorDarkShade};
-`;
-
-const ViewMore = styled.div`
- height: ${theme.euiSize};
- line-height: ${theme.euiSize};
- text-align: center;
- font-size: ${theme.euiFontSizeXs};
- margin: ${theme.euiSizeS};
-`;
-
-const PressReturn = styled.div`
- border-top: ${theme.euiBorderWidthThin} solid ${theme.euiBorderColor};
- padding: ${theme.euiSizeS};
- text-align: center;
- font-weight: bold;
-`;
-
-const PressReturnText = styled.div`
- background: ${theme.euiColorLightShade};
- margin: ${theme.euiSizeS};
- padding: ${theme.euiSizeS};
-`;
-
export class SuggestionsComponent extends Component {
private childNodes: HTMLDivElement[] = [];
private parentNode: HTMLDivElement | null = null;
@@ -84,9 +42,7 @@ export class SuggestionsComponent extends Component {
{this.renderSuggestionGroups()}
-
- Press ⮐ Return for Full Text Search
-
+
Press ⮐ Return for Full Text Search
@@ -129,18 +85,21 @@ export class SuggestionsComponent extends Component {
);
const groupHeader = (
-
-
+
+
-
+
{this.getGroupTitle(group.type)}
-
-
-
+
+
+
{total} Result
{total === 1 ? '' : 's'}
-
-
+
+
);
const viewMoreUrl = Url.format({
@@ -150,9 +109,9 @@ export class SuggestionsComponent extends Component {
},
});
const viewMore = (
-
+
View More
-
+
);
return (