From 602ce3f887729620dda7ef72cc071018b412fa6a Mon Sep 17 00:00:00 2001 From: Elizabet Oliveira <elizabet.oliveira@gmail.com> Date: Thu, 23 Jul 2020 17:26:12 +0100 Subject: [PATCH] Add returnKey glyph to EuiIcon (#3783) * Adding return glyph to EuiIcon * Deleting non required code * Updating CL number * Improving icon * Updating icon position * Renaming icon * Snapshot * removing unnecessary file --- CHANGELOG.md | 1 + src-docs/src/views/icon/icons.js | 1 + .../icon/__snapshots__/icon.test.tsx.snap | 17 +++++++++++++++++ src/components/icon/assets/return_key.js | 16 ++++++++++++++++ src/components/icon/assets/return_key.svg | 3 +++ src/components/icon/icon.tsx | 1 + 6 files changed, 39 insertions(+) create mode 100644 src/components/icon/assets/return_key.js create mode 100644 src/components/icon/assets/return_key.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 62a290db75b..3da36124c60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) - Updated lodash to `v4.17.19` ([#3764](https://github.com/elastic/eui/pull/3764)) +- Added `returnKey` glyph to `EuiIcon` ([#3783](https://github.com/elastic/eui/pull/3783)) ## [`27.2.0`](https://github.com/elastic/eui/tree/v27.2.0) diff --git a/src-docs/src/views/icon/icons.js b/src-docs/src/views/icon/icons.js index 180512c64f7..384ed3cc0dc 100644 --- a/src-docs/src/views/icon/icons.js +++ b/src-docs/src/views/icon/icons.js @@ -162,6 +162,7 @@ export const iconTypes = [ 'quote', 'refresh', 'reporter', + 'returnKey', 'save', 'scale', 'search', diff --git a/src/components/icon/__snapshots__/icon.test.tsx.snap b/src/components/icon/__snapshots__/icon.test.tsx.snap index f17958fee77..d3f96738f9e 100644 --- a/src/components/icon/__snapshots__/icon.test.tsx.snap +++ b/src/components/icon/__snapshots__/icon.test.tsx.snap @@ -6706,6 +6706,23 @@ exports[`EuiIcon props type reportingApp is rendered 1`] = ` </svg> `; +exports[`EuiIcon props type returnKey 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="M11.994 4c1.059 0 1.924.818 2 1.856l.006.15v1.988a2.005 2.005 0 01-1.856 2L12 10H3.484l1.91 1.82a.52.52 0 010 .77.616.616 0 01-.829 0l-2.05-1.95a1.551 1.551 0 010-2.31l2.05-1.95a.617.617 0 01.83 0 .52.52 0 010 .77L3.45 9H12c.514-.003.935-.39.993-.888L13 7.994V6.006c0-.516-.388-.941-.888-1L11.994 5H9.5a.5.5 0 01-.09-.992L9.5 4h2.494z" + /> +</svg> +`; + exports[`EuiIcon props type save is rendered 1`] = ` <svg aria-hidden="true" diff --git a/src/components/icon/assets/return_key.js b/src/components/icon/assets/return_key.js new file mode 100644 index 00000000000..c7409a38e98 --- /dev/null +++ b/src/components/icon/assets/return_key.js @@ -0,0 +1,16 @@ +import React from 'react'; + +const EuiIconReturnKey = ({ 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="M11.994 4c1.059 0 1.924.818 2 1.856l.006.15v1.988a2.005 2.005 0 01-1.856 2L12 10H3.484l1.91 1.82a.52.52 0 010 .77.616.616 0 01-.829 0l-2.05-1.95a1.551 1.551 0 010-2.31l2.05-1.95a.617.617 0 01.83 0 .52.52 0 010 .77L3.45 9H12c.514-.003.935-.39.993-.888L13 7.994V6.006c0-.516-.388-.941-.888-1L11.994 5H9.5a.5.5 0 01-.09-.992L9.5 4h2.494z" /> + </svg> +); + +export const icon = EuiIconReturnKey; diff --git a/src/components/icon/assets/return_key.svg b/src/components/icon/assets/return_key.svg new file mode 100644 index 00000000000..bc2dd3fdeec --- /dev/null +++ b/src/components/icon/assets/return_key.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"> + <path d="M11.994 4c1.059 0 1.924.818 2 1.856l.006.15v1.988a2.005 2.005 0 01-1.856 2L12 10H3.484l1.91 1.82a.52.52 0 010 .77.616.616 0 01-.829 0l-2.05-1.95a1.551 1.551 0 010-2.31l2.05-1.95a.617.617 0 01.83 0 .52.52 0 010 .77L3.45 9H12c.514-.003.935-.39.993-.888L13 7.994V6.006c0-.516-.388-.941-.888-1L11.994 5H9.5a.5.5 0 01-.09-.992L9.5 4h2.494z" /> +</svg> \ No newline at end of file diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx index 95874fc7418..1e1391a263d 100644 --- a/src/components/icon/icon.tsx +++ b/src/components/icon/icon.tsx @@ -301,6 +301,7 @@ const typeToPathMap = { refresh: 'refresh', reporter: 'reporter', reportingApp: 'app_reporting', + returnKey: 'return_key', save: 'save', savedObjectsApp: 'app_saved_objects', scale: 'scale',