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

[Icons] Adding fold and unfold glyphs to EuiIcon #3994

Merged
merged 7 commits into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `fold` and `unfold` glyphs to `EuiIcon` ([#3994](https://github.com/elastic/eui/pull/3994))

**Bug fixes**

- Fixed bug in `EuiComboBox` where the input was dropping to the next line when a `EuiBadge` had a very long text ([#3968](https://github.com/elastic/eui/pull/3968))
Expand Down
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 @@ -82,6 +82,7 @@ export const iconTypes = [
'faceSad',
'filter',
'flag',
'fold',
'folderCheck',
'folderClosed',
'folderExclamation',
Expand Down Expand Up @@ -202,6 +203,7 @@ export const iconTypes = [
'timeline',
'training',
'trash',
'unfold',
'unlink',
'user',
'users',
Expand Down
30 changes: 30 additions & 0 deletions src/components/icon/__snapshots__/icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,21 @@ exports[`EuiIcon props type flag is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type fold is rendered 1`] = `
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoaded"
focusable="false"
role="img"
viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.14.192L7.53 2.49a.67.67 0 00.942 0L10.86.192a.677.677 0 01.944 0 .65.65 0 010 .93l-2.388 2.3a2.02 2.02 0 01-2.832 0l-2.388-2.3a.65.65 0 010-.93.677.677 0 01.944 0zm0 15.616l2.39-2.298a.67.67 0 01.942 0l2.389 2.298c.26.256.685.256.944 0a.65.65 0 000-.93l-2.388-2.3a2.02 2.02 0 00-2.832 0l-2.388 2.3a.65.65 0 000 .93c.26.256.683.256.944 0zM16 6H0v4h16V6zM1 9V7h14v2H1z"
/>
</svg>
`;

exports[`EuiIcon props type folderCheck is rendered 1`] = `
<svg
aria-hidden="true"
Expand Down Expand Up @@ -8643,6 +8658,21 @@ exports[`EuiIcon props type trash is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type unfold is rendered 1`] = `
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoaded"
focusable="false"
role="img"
viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.14 3.808L7.53 1.51a.67.67 0 01.942 0l2.389 2.298c.26.256.685.256.944 0a.65.65 0 000-.93L9.416.578a2.02 2.02 0 00-2.832 0l-2.388 2.3a.65.65 0 000 .93c.26.256.683.256.944 0zm0 8.384l2.39 2.298a.67.67 0 00.942 0l2.389-2.298a.677.677 0 01.944 0 .65.65 0 010 .93l-2.388 2.3a2.02 2.02 0 01-2.832 0l-2.388-2.3a.65.65 0 010-.93.677.677 0 01.944 0zM16 6H0v4h16V6zM1 9V7h14v2H1z"
/>
</svg>
`;

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

const EuiIconFold = ({ title, titleId, ...props }) => (
<svg
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="M5.14.192L7.53 2.49a.67.67 0 00.942 0L10.86.192a.677.677 0 01.944 0 .65.65 0 010 .93l-2.388 2.3a2.02 2.02 0 01-2.832 0l-2.388-2.3a.65.65 0 010-.93.677.677 0 01.944 0zm0 15.616l2.39-2.298a.67.67 0 01.942 0l2.389 2.298c.26.256.685.256.944 0a.65.65 0 000-.93l-2.388-2.3a2.02 2.02 0 00-2.832 0l-2.388 2.3a.65.65 0 000 .93c.26.256.683.256.944 0zM16 6H0v4h16V6zM1 9V7h14v2H1z" />
</svg>
);

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

const EuiIconUnfold = ({ title, titleId, ...props }) => (
<svg
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="M5.14 3.808L7.53 1.51a.67.67 0 01.942 0l2.389 2.298c.26.256.685.256.944 0a.65.65 0 000-.93L9.416.578a2.02 2.02 0 00-2.832 0l-2.388 2.3a.65.65 0 000 .93c.26.256.683.256.944 0zm0 8.384l2.39 2.298a.67.67 0 00.942 0l2.389-2.298a.677.677 0 01.944 0 .65.65 0 010 .93l-2.388 2.3a2.02 2.02 0 01-2.832 0l-2.388-2.3a.65.65 0 010-.93.677.677 0 01.944 0zM16 6H0v4h16V6zM1 9V7h14v2H1z" />
</svg>
);

export const icon = EuiIconUnfold;
1 change: 1 addition & 0 deletions src/components/icon/assets/unfold.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 @@ -146,6 +146,7 @@ const typeToPathMap = {
filebeatApp: 'app_filebeat',
filter: 'filter',
flag: 'flag',
fold: 'fold',
folderCheck: 'folder_check',
folderClosed: 'folder_closed',
folderExclamation: 'folder_exclamation',
Expand Down Expand Up @@ -356,6 +357,7 @@ const typeToPathMap = {
trash: 'trash',
upgradeAssistantApp: 'app_upgrade_assistant',
uptimeApp: 'app_uptime',
unfold: 'unfold',
unlink: 'unlink',
user: 'user',
users: 'users',
Expand Down