Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon keyboard shortcut #2413

Merged
merged 6 commits into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down
1 change: 1 addition & 0 deletions src-docs/src/views/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const iconTypes = [
'inspect',
'invert',
'ip',
'keyboardShortcut',
'kqlField',
'kqlFunction',
'kqlOperand',
Expand Down
17 changes: 17 additions & 0 deletions src/components/icon/__snapshots__/icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,23 @@ exports[`EuiIcon props type ip is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type keyboardShortcut is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium euiIcon-isLoaded"
focusable="false"
height="16"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
clip-rule="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-rule="evenodd"
/>
</svg>
`;

exports[`EuiIcon props type kqlField is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium euiIcon-isLoaded"
Expand Down
14 changes: 14 additions & 0 deletions src/components/icon/assets/keyboard_shortcut.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

const EuiIconKeyboardShortcut = props => (
<svg
width={16}
height={16}
viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg"
{...props}>
<path d="M15 9a1 1 0 0 1 .993.883L16 10v5a1 1 0 0 1-.883.993L15 16H7a1 1 0 0 1-.993-.883L6 15v-5a1 1 0 0 1 .883-.993L7 9h8zM2.5 10a.5.5 0 0 1 .492.41L3 10.5V12h1.5a.5.5 0 0 1 .09.992L4.5 13H3v1.5a.5.5 0 0 1-.992.09L2 14.5V13H.5a.5.5 0 0 1-.09-.992L.5 12H2v-1.5a.5.5 0 0 1 .5-.5zM15 10H7v5h8v-5zm-1 3v1H8v-1h6zm1-13a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h14zm0 1H1v5h14V1zM8 4v1H2V4h6z" />
</svg>
);

export const icon = EuiIconKeyboardShortcut;
3 changes: 3 additions & 0 deletions src/components/icon/assets/keyboard_shortcut.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const typeToPathMap = {
inspect: 'inspect',
invert: 'invert',
ip: 'ip',
keyboardShortcut: 'keyboard_shortcut',
kqlField: 'kql_field',
kqlFunction: 'kql_function',
kqlOperand: 'kql_operand',
Expand Down