Skip to content

Commit 07daf4a

Browse files
author
Constance
authored
[Enterprise Search] Fix various icons in dark mode (#76430) (#76461)
* Update Home catalogue icons to use new 28.0 EUI app icons * Fix App Search engine icons in dark mode - Convert to React SVG element in order to be able to inherit correct fill in dark mode - Fix vertical centering (taking advantage of SVG centering for us) - Move icons directly to the engines overview component instead of having to reach upwards to a shared assets folder for them * [Cleanup] Move Setup Guide images - to be nested within their own component views that use them, instead of having to grab them upwards from a shared assets folder
1 parent 02770a0 commit 07daf4a

File tree

13 files changed

+64
-27
lines changed

13 files changed

+64
-27
lines changed

x-pack/plugins/enterprise_search/public/applications/app_search/assets/engine.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

x-pack/plugins/enterprise_search/public/applications/app_search/assets/logo.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

x-pack/plugins/enterprise_search/public/applications/app_search/assets/meta_engine.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import React from 'react';
8+
9+
export const EngineIcon: React.FC = () => (
10+
<svg
11+
xmlns="http://www.w3.org/2000/svg"
12+
viewBox="0 0 18 18"
13+
width="18"
14+
height="18"
15+
className="euiIcon engineIcon"
16+
aria-hidden="true"
17+
>
18+
<path
19+
fillRule="evenodd"
20+
clipRule="evenodd"
21+
d="M9.776 1.389a7.66 7.66 0 00-.725-.04v.001H9a7.65 7.65 0 00-.051 15.301v-.001H9a7.65 7.65 0 00.776-15.261zm-1.52 1.254a6.401 6.401 0 00.02 12.716l2.333-3.791a.875.875 0 00-.354-1.242l-3.07-1.534a2.125 2.125 0 01-.859-3.015l1.93-3.134zm1.489 12.714l1.929-3.134a2.125 2.125 0 00-.86-3.015l-3.07-1.534a.875.875 0 01-.353-1.242L9.724 2.64a6.401 6.401 0 01.02 12.717z"
22+
/>
23+
</svg>
24+
);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import React from 'react';
8+
9+
export const MetaEngineIcon: React.FC = () => (
10+
<svg
11+
xmlns="http://www.w3.org/2000/svg"
12+
viewBox="0 0 18 18"
13+
width="18"
14+
height="18"
15+
className="euiIcon engineIcon"
16+
aria-hidden="true"
17+
>
18+
<path
19+
fillRule="evenodd"
20+
clipRule="evenodd"
21+
d="M4 9a5.002 5.002 0 005 5 5 5 0 10-5-5zm5.506 1.653L8.37 12.697a3.751 3.751 0 01-.003-7.394L7.402 7.04a1.625 1.625 0 00.519 2.142l1.465.976a.375.375 0 01.12.495zm1.092.607l-.777 1.4a3.751 3.751 0 00-.04-7.329L8.494 7.647a.375.375 0 00.12.495l1.465.976c.705.47.93 1.402.52 2.142z"
22+
/>
23+
<path
24+
fillRule="evenodd"
25+
clipRule="evenodd"
26+
d="M6.5 1.375A5.125 5.125 0 001.375 6.5v5A5.125 5.125 0 006.5 16.625h5a5.125 5.125 0 005.125-5.125v-5A5.125 5.125 0 0011.5 1.375h-5zM2.625 6.5A3.875 3.875 0 016.5 2.625h5A3.875 3.875 0 0115.375 6.5v5a3.875 3.875 0 01-3.875 3.875h-5A3.875 3.875 0 012.625 11.5v-5z"
27+
/>
28+
</svg>
29+
);

x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
.engineIcon {
1616
display: inline-block;
1717
width: $euiSize;
18-
height: $euiSize;
18+
// Use line-height of EuiTitle - SVG will vertically center accordingly
19+
height: map-get(map-get($euiTitles, 's'), 'line-height');
20+
vertical-align: top;
1921
margin-right: $euiSizeXS;
2022
}

x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { FlashMessages } from '../../../shared/flash_messages';
2020
import { LicenseContext, ILicenseContext, hasPlatinumLicense } from '../../../shared/licensing';
2121
import { KibanaContext, IKibanaContext } from '../../../index';
2222

23-
import EnginesIcon from '../../assets/engine.svg';
24-
import MetaEnginesIcon from '../../assets/meta_engine.svg';
23+
import { EngineIcon } from './assets/engine_icon';
24+
import { MetaEngineIcon } from './assets/meta_engine_icon';
2525

2626
import { EngineOverviewHeader, LoadingState, EmptyState } from './components';
2727
import { EngineTable } from './engine_table';
@@ -93,7 +93,7 @@ export const EngineOverview: React.FC = () => {
9393
<EuiPageContentHeader>
9494
<EuiTitle size="s">
9595
<h2>
96-
<img src={EnginesIcon} alt="" className="engineIcon" />
96+
<EngineIcon />
9797
<FormattedMessage
9898
id="xpack.enterpriseSearch.appSearch.enginesOverview.engines"
9999
defaultMessage="Engines"
@@ -118,7 +118,7 @@ export const EngineOverview: React.FC = () => {
118118
<EuiPageContentHeader>
119119
<EuiTitle size="s">
120120
<h2>
121-
<img src={MetaEnginesIcon} alt="" className="engineIcon" />
121+
<MetaEngineIcon />
122122
<FormattedMessage
123123
id="xpack.enterpriseSearch.appSearch.enginesOverview.metaEngines"
124124
defaultMessage="Meta Engines"

x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { APP_SEARCH_PLUGIN } from '../../../../../common/constants';
1313
import { SetupGuide as SetupGuideLayout } from '../../../shared/setup_guide';
1414
import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome';
1515
import { SendAppSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
16-
import GettingStarted from '../../assets/getting_started.png';
16+
import GettingStarted from './assets/getting_started.png';
1717

1818
export const SetupGuide: React.FC = () => (
1919
<SetupGuideLayout

x-pack/plugins/enterprise_search/public/applications/workplace_search/assets/logo.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)