Skip to content

Commit 7346052

Browse files
ek-somgadewoll
andauthored
Adding contrast and contrastHigh icons for the upcoming high contrast mode functionality (elastic#8216)
Co-authored-by: Lene Gadewoll <[email protected]>
1 parent 7ec3faf commit 7346052

File tree

10 files changed

+129
-0
lines changed

10 files changed

+129
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Added two new icons: `contrast` and `contrastHigh`
2+

packages/eui/src-docs/src/views/icon/icons.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export const iconTypes = [
6262
'continuityAboveBelow',
6363
'continuityBelow',
6464
'continuityWithin',
65+
'contrast',
66+
'contrastHigh',
6567
'controlsHorizontal',
6668
'controlsVertical',
6769
'copy',

packages/eui/src/components/icon/__snapshots__/icon.test.tsx.snap

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,6 +1781,45 @@ exports[`EuiIcon props type continuityWithin is rendered 1`] = `
17811781
</svg>
17821782
`;
17831783

1784+
exports[`EuiIcon props type contrast is rendered 1`] = `
1785+
<svg
1786+
aria-hidden="true"
1787+
class="euiIcon emotion-euiIcon-m-isLoaded"
1788+
data-icon-type="contrast"
1789+
data-is-loaded="true"
1790+
height="16"
1791+
role="img"
1792+
viewBox="0 0 16 16"
1793+
width="16"
1794+
xmlns="http://www.w3.org/2000/svg"
1795+
>
1796+
<path
1797+
clip-rule="evenodd"
1798+
d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm.5-1.5h1.902a6.004 6.004 0 0 0 1.567-1H8.5v1Zm0-2h4.374c.225-.312.42-.647.582-1H8.5v1Zm0-2h5.311c.083-.324.14-.658.168-1H8.5v1Zm0-2h5.48a5.988 5.988 0 0 0-.169-1H8.5v1Zm0-2h4.956a5.996 5.996 0 0 0-.582-1H8.5v1Zm0-2h3.469a6.004 6.004 0 0 0-1.567-1H8.5v1ZM2 8a6 6 0 0 1 5.5-5.98v11.96A6 6 0 0 1 2 8Z"
1799+
fill-rule="evenodd"
1800+
/>
1801+
</svg>
1802+
`;
1803+
1804+
exports[`EuiIcon props type contrastHigh is rendered 1`] = `
1805+
<svg
1806+
aria-hidden="true"
1807+
class="euiIcon emotion-euiIcon-m-isLoaded"
1808+
data-icon-type="contrastHigh"
1809+
data-is-loaded="true"
1810+
height="16"
1811+
role="img"
1812+
viewBox="0 0 16 16"
1813+
width="16"
1814+
xmlns="http://www.w3.org/2000/svg"
1815+
>
1816+
<path
1817+
clip-rule="evenodd"
1818+
d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0Zm-7 6V2a6 6 0 1 0 0 12Z"
1819+
/>
1820+
</svg>
1821+
`;
1822+
17841823
exports[`EuiIcon props type controlsHorizontal is rendered 1`] = `
17851824
<svg
17861825
aria-hidden="true"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
10+
11+
import * as React from 'react';
12+
import type { SVGProps } from 'react';
13+
interface SVGRProps {
14+
title?: string;
15+
titleId?: string;
16+
}
17+
const EuiIconContrast = ({
18+
title,
19+
titleId,
20+
...props
21+
}: SVGProps<SVGSVGElement> & SVGRProps) => (
22+
<svg
23+
xmlns="http://www.w3.org/2000/svg"
24+
width={16}
25+
height={16}
26+
viewBox="0 0 16 16"
27+
aria-labelledby={titleId}
28+
{...props}
29+
>
30+
{title ? <title id={titleId}>{title}</title> : null}
31+
<path
32+
fillRule="evenodd"
33+
d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm.5-1.5h1.902a6.004 6.004 0 0 0 1.567-1H8.5v1Zm0-2h4.374c.225-.312.42-.647.582-1H8.5v1Zm0-2h5.311c.083-.324.14-.658.168-1H8.5v1Zm0-2h5.48a5.988 5.988 0 0 0-.169-1H8.5v1Zm0-2h4.956a5.996 5.996 0 0 0-.582-1H8.5v1Zm0-2h3.469a6.004 6.004 0 0 0-1.567-1H8.5v1ZM2 8a6 6 0 0 1 5.5-5.98v11.96A6 6 0 0 1 2 8Z"
34+
clipRule="evenodd"
35+
/>
36+
</svg>
37+
);
38+
export const icon = EuiIconContrast;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
10+
11+
import * as React from 'react';
12+
import type { SVGProps } from 'react';
13+
interface SVGRProps {
14+
title?: string;
15+
titleId?: string;
16+
}
17+
const EuiIconContrastHigh = ({
18+
title,
19+
titleId,
20+
...props
21+
}: SVGProps<SVGSVGElement> & SVGRProps) => (
22+
<svg
23+
xmlns="http://www.w3.org/2000/svg"
24+
width={16}
25+
height={16}
26+
viewBox="0 0 16 16"
27+
aria-labelledby={titleId}
28+
{...props}
29+
>
30+
{title ? <title id={titleId}>{title}</title> : null}
31+
<path
32+
d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0Zm-7 6V2a6 6 0 1 0 0 12Z"
33+
clipRule="evenodd"
34+
/>
35+
</svg>
36+
);
37+
export const icon = EuiIconContrastHigh;

packages/eui/src/components/icon/icon_map.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export const typeToPathMap = {
6969
continuityAboveBelow: 'continuityAboveBelow',
7070
continuityBelow: 'continuityBelow',
7171
continuityWithin: 'continuityWithin',
72+
contrast: 'contrast',
73+
contrastHigh: 'contrastHigh',
7274
controlsHorizontal: 'controls_horizontal',
7375
controlsVertical: 'controls_vertical',
7476
copy: 'copy',
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

packages/website/docs/components/display/icons/icon_types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export const iconTypes: Array<IconType> = [
5252
'continuityAboveBelow',
5353
'continuityBelow',
5454
'continuityWithin',
55+
'contrast',
56+
'contrastHigh',
5557
'controlsHorizontal',
5658
'controlsVertical',
5759
'copy',

wiki/contributing-to-eui/developing/creating-icons.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ _1. Add your glyph to the `EuiIcon` component_
6666

6767
_2. Display the icon in the docs_
6868
- Add the icon name to `/packages/eui/src-docs/src/views/icon/icons.js` *
69+
- Add the icon name to `/packages/website/docs/components/display/icons/icon_types.ts` *
6970

7071
_3. Compile and test_
7172
- Go to the `packages/eui` directory

0 commit comments

Comments
 (0)