Skip to content

Commit

Permalink
[K8 Nav Feature] Added home and menu glyphs to EuiIcon (#3109)
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos authored and cchaos committed Mar 26, 2020
1 parent 351bf4e commit dbe9792
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src-docs/src/views/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const iconTypes = [
'heart',
'heatmap',
'help',
'home',
'iInCircle',
'image',
'importAction',
Expand Down Expand Up @@ -129,6 +130,7 @@ export const iconTypes = [
'mapMarker',
'memory',
'merge',
'menu',
'menuLeft',
'menuRight',
'minimize',
Expand Down
35 changes: 35 additions & 0 deletions src/components/icon/__snapshots__/icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2697,6 +2697,23 @@ exports[`EuiIcon props type help is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type home is rendered 1`] = `
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoaded"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8.13 1.229l5.5 4.47a1 1 0 01.37.777V14a1 1 0 01-1 1H2a1 1 0 01-1-1V6.476a1 1 0 01.37-.776l5.5-4.471a1 1 0 011.26 0zM13 6.476L7.5 2.005 2 6.475V14h11V6.476z"
/>
</svg>
`;

exports[`EuiIcon props type iInCircle is rendered 1`] = `
<svg
aria-hidden="true"
Expand Down Expand Up @@ -5932,6 +5949,24 @@ exports[`EuiIcon props type memory is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type menu is rendered 1`] = `
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoaded"
fill="none"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 2h16v2H0V2zm0 5h16v2H0V7zm16 5H0v2h16v-2z"
/>
</svg>
`;

exports[`EuiIcon props type menuLeft is rendered 1`] = `
<svg
aria-hidden="true"
Expand Down
16 changes: 16 additions & 0 deletions src/components/icon/assets/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';

const EuiIconHome = ({ title, titleId, ...props }) => (
<svg
width={16}
height={16}
viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg"
aria-labelledby={titleId}
{...props}>
{title ? <title id={titleId}>{title}</title> : null}
<path d="M8.13 1.229l5.5 4.47a1 1 0 01.37.777V14a1 1 0 01-1 1H2a1 1 0 01-1-1V6.476a1 1 0 01.37-.776l5.5-4.471a1 1 0 011.26 0zM13 6.476L7.5 2.005 2 6.475V14h11V6.476z" />
</svg>
);

export const icon = EuiIconHome;
3 changes: 3 additions & 0 deletions src/components/icon/assets/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/components/icon/assets/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';

const EuiIconMenu = ({ title, titleId, ...props }) => (
<svg
width={16}
height={16}
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-labelledby={titleId}
{...props}>
{title ? <title id={titleId}>{title}</title> : null}
<path d="M0 2h16v2H0V2zm0 5h16v2H0V7zm16 5H0v2h16v-2z" />
</svg>
);

export const icon = EuiIconMenu;
3 changes: 3 additions & 0 deletions src/components/icon/assets/menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ const typeToPathMap = {
heartbeatApp: 'app_heartbeat',
heatmap: 'heatmap',
help: 'help',
home: 'home',
iInCircle: 'iInCircle',
image: 'image',
importAction: 'import',
Expand Down Expand Up @@ -241,6 +242,7 @@ const typeToPathMap = {
managementApp: 'app_management',
mapMarker: 'map_marker',
memory: 'memory',
menu: 'menu',
menuLeft: 'menuLeft',
menuRight: 'menuRight',
merge: 'merge',
Expand Down

0 comments on commit dbe9792

Please sign in to comment.