From a41935ff825946c23bd82ed06f2262b92cb714b3 Mon Sep 17 00:00:00 2001 From: defazio Date: Thu, 10 Oct 2019 15:57:58 -0400 Subject: [PATCH 1/6] Add keyboard shortcut icon [#1573] --- src-docs/src/views/icon/icons.js | 1 + .../icon/assets/keyboard_shortcut.js | 19 +++++++++++++++++++ .../icon/assets/keyboard_shortcut.svg | 3 +++ src/components/icon/icon.tsx | 1 + 4 files changed, 24 insertions(+) create mode 100644 src/components/icon/assets/keyboard_shortcut.js create mode 100644 src/components/icon/assets/keyboard_shortcut.svg diff --git a/src-docs/src/views/icon/icons.js b/src-docs/src/views/icon/icons.js index 2626da56c8e..f96b047a872 100644 --- a/src-docs/src/views/icon/icons.js +++ b/src-docs/src/views/icon/icons.js @@ -98,6 +98,7 @@ const iconTypes = [ 'inspect', 'invert', 'ip', + 'keyboardShortcut', 'kqlField', 'kqlFunction', 'kqlOperand', diff --git a/src/components/icon/assets/keyboard_shortcut.js b/src/components/icon/assets/keyboard_shortcut.js new file mode 100644 index 00000000000..029efdc32fb --- /dev/null +++ b/src/components/icon/assets/keyboard_shortcut.js @@ -0,0 +1,19 @@ +import React from 'react'; + +const EuiIconKeyboardShortcut = props => ( + + + +); + +export const icon = EuiIconKeyboardShortcut; diff --git a/src/components/icon/assets/keyboard_shortcut.svg b/src/components/icon/assets/keyboard_shortcut.svg new file mode 100644 index 00000000000..350e0d12354 --- /dev/null +++ b/src/components/icon/assets/keyboard_shortcut.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx index 2989736c85c..8c51db403e6 100644 --- a/src/components/icon/icon.tsx +++ b/src/components/icon/icon.tsx @@ -148,6 +148,7 @@ const typeToPathMap = { inspect: 'inspect', invert: 'invert', ip: 'ip', + keyboardShortcut: 'keyboard_shortcut', kqlField: 'kql_field', kqlFunction: 'kql_function', kqlOperand: 'kql_operand', From 2abeb3cb5aa063ae9c383486c4c992b65ec07a24 Mon Sep 17 00:00:00 2001 From: defazio Date: Thu, 10 Oct 2019 16:00:11 -0400 Subject: [PATCH 2/6] Update icon snapshot --- .../icon/__snapshots__/icon.test.tsx.snap | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/components/icon/__snapshots__/icon.test.tsx.snap b/src/components/icon/__snapshots__/icon.test.tsx.snap index c68441bc805..c9a0700632d 100644 --- a/src/components/icon/__snapshots__/icon.test.tsx.snap +++ b/src/components/icon/__snapshots__/icon.test.tsx.snap @@ -2539,6 +2539,24 @@ exports[`EuiIcon props type ip is rendered 1`] = ` `; +exports[`EuiIcon props type keyboardShortcut is rendered 1`] = ` + + + +`; + exports[`EuiIcon props type kqlField is rendered 1`] = ` Date: Thu, 10 Oct 2019 16:38:02 -0400 Subject: [PATCH 3/6] Fix fill rule --- src/components/icon/assets/keyboard_shortcut.js | 1 - src/components/icon/assets/keyboard_shortcut.svg | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/icon/assets/keyboard_shortcut.js b/src/components/icon/assets/keyboard_shortcut.js index 029efdc32fb..934efc65251 100644 --- a/src/components/icon/assets/keyboard_shortcut.js +++ b/src/components/icon/assets/keyboard_shortcut.js @@ -11,7 +11,6 @@ const EuiIconKeyboardShortcut = props => ( fillRule="evenodd" clipRule="evenodd" d="M1 1h14v5H1V1zM0 1a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V1zm2 3h6v1H2V4zm1 6H2v2H0v1h2v2h1v-2h2v-1H3v-2zm11 3H8v1h6v-1zm1-3H7v5h8v-5zM7 9a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H7z" - fill="#333" /> ); diff --git a/src/components/icon/assets/keyboard_shortcut.svg b/src/components/icon/assets/keyboard_shortcut.svg index 350e0d12354..3ae74ee5e74 100644 --- a/src/components/icon/assets/keyboard_shortcut.svg +++ b/src/components/icon/assets/keyboard_shortcut.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file From e83d48f64f4076dcd2cfedae33c6eb7757e174cf Mon Sep 17 00:00:00 2001 From: defazio Date: Thu, 10 Oct 2019 16:51:31 -0400 Subject: [PATCH 4/6] Update changelog and snapshot --- CHANGELOG.md | 1 + src/components/icon/__snapshots__/icon.test.tsx.snap | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43d33b7df8e..655b6acc351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Added `currency` glyph to 'EuiIcon' ([#2398](https://github.com/elastic/eui/pull/2398)) - Migrate `EuiBreadcrumbs`, `EuiHeader` etc, and `EuiLink` to TypeScript ([#2391](https://github.com/elastic/eui/pull/2391)) - Added focus state to `EuiListGroupItem` ([#2406](https://github.com/elastic/eui/pull/2406)) +- Added `keyboardShorcut` glyph to 'EuiIcon ([#2413](https://github.com/elastic/eui/pull/2413)) **Bug fixes** diff --git a/src/components/icon/__snapshots__/icon.test.tsx.snap b/src/components/icon/__snapshots__/icon.test.tsx.snap index c9a0700632d..b5146517b10 100644 --- a/src/components/icon/__snapshots__/icon.test.tsx.snap +++ b/src/components/icon/__snapshots__/icon.test.tsx.snap @@ -2551,7 +2551,6 @@ exports[`EuiIcon props type keyboardShortcut is rendered 1`] = ` From a14f5ef7eba8a32d4fab519f49892b3f64b82dbc Mon Sep 17 00:00:00 2001 From: defazio Date: Fri, 11 Oct 2019 10:56:31 -0400 Subject: [PATCH 5/6] Fix svg code --- src/components/icon/assets/keyboard_shortcut.js | 6 +----- src/components/icon/assets/keyboard_shortcut.svg | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/icon/assets/keyboard_shortcut.js b/src/components/icon/assets/keyboard_shortcut.js index 934efc65251..d44050a1c4e 100644 --- a/src/components/icon/assets/keyboard_shortcut.js +++ b/src/components/icon/assets/keyboard_shortcut.js @@ -7,11 +7,7 @@ const EuiIconKeyboardShortcut = props => ( viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" {...props}> - + ); diff --git a/src/components/icon/assets/keyboard_shortcut.svg b/src/components/icon/assets/keyboard_shortcut.svg index 3ae74ee5e74..4fd1b835d63 100644 --- a/src/components/icon/assets/keyboard_shortcut.svg +++ b/src/components/icon/assets/keyboard_shortcut.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file From 47f0e3a7f0a55a1731532fab8a9d1d963d3dff5c Mon Sep 17 00:00:00 2001 From: defazio Date: Fri, 11 Oct 2019 13:33:44 -0400 Subject: [PATCH 6/6] Update snapshot --- src/components/icon/__snapshots__/icon.test.tsx.snap | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/icon/__snapshots__/icon.test.tsx.snap b/src/components/icon/__snapshots__/icon.test.tsx.snap index b5146517b10..74dc200aef5 100644 --- a/src/components/icon/__snapshots__/icon.test.tsx.snap +++ b/src/components/icon/__snapshots__/icon.test.tsx.snap @@ -2549,9 +2549,7 @@ exports[`EuiIcon props type keyboardShortcut is rendered 1`] = ` xmlns="http://www.w3.org/2000/svg" > `;