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

[EuiIcon] Fix two-tone icons to inherit parent color when nested in specific components #4760

Merged
merged 13 commits into from
Apr 30, 2021
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

- Fixed `initialFocus` prop functionality in `EuiPopover` ([#4768](https://github.com/elastic/eui/pull/4768))
- Fixed `description` prop in `EuiTable`([#4754](https://github.com/elastic/eui/pull/4754))
- Added `inherit` color option to `EuiIcon` to force two-tone (app) icons to inherit their parent's color ([#4760](https://github.com/elastic/eui/pull/4760))
miukimiu marked this conversation as resolved.
Show resolved Hide resolved
- Updated `[EuiBetaBadge, EuiBadge, EuiButtonIcon, EuiButtonContent, EuiCallOut, EuiContextMenuItem, EuiListGroupItem]` icon usage to inherit their parent's color ([#4760](https://github.com/elastic/eui/pull/4760))
miukimiu marked this conversation as resolved.
Show resolved Hide resolved
- Added `iconProps` prop to `EuiListGroupItem` ([#4760](https://github.com/elastic/eui/pull/4760))

## [`32.3.0`](https://github.com/elastic/eui/tree/v32.3.0)

Expand All @@ -12,7 +15,7 @@
**Bug fixes**

- Fixed missing i18n tokens for `EuiFilePicker` ([#4750](https://github.com/elastic/eui/pull/4750))
- Fixed `EuiComoboBox` to use correct placeholder text color ([#4744](https://github.com/elastic/eui/pull/4744))
- Fixed `EuiComboBox` to use correct placeholder text color ([#4744](https://github.com/elastic/eui/pull/4744))

## [`32.2.0`](https://github.com/elastic/eui/tree/v32.2.0)

Expand Down
2 changes: 2 additions & 0 deletions src-docs/src/views/badge/badge_with_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export default () => (

<EuiBadge iconType="check">Default</EuiBadge>

<EuiBadge iconType="lensApp">Primary with an app icon</EuiBadge>
miukimiu marked this conversation as resolved.
Show resolved Hide resolved

<EuiBadge iconType="returnKey" />
</div>
);
2 changes: 2 additions & 0 deletions src-docs/src/views/badge/beta_badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default () => (
/>
&emsp;
<EuiBetaBadge label="Lab" iconType="beaker" />
&emsp;
<EuiBetaBadge label="Lens" iconType="lensApp" />
<EuiSpacer />
<EuiTitle size="s">
<h3>
Expand Down
24 changes: 21 additions & 3 deletions src-docs/src/views/button/button_empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,34 @@ export default () => (
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiButtonEmpty onClick={() => {}} iconType="arrowDown">
Icon left
Primary with icon left
</EuiButtonEmpty>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiButtonEmpty
onClick={() => {}}
iconType="arrowDown"
iconSide="right">
Icon right
iconSide="right"
size="xs">
Extra small with icon right
</EuiButtonEmpty>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiButtonEmpty color="text" onClick={() => {}} iconType="dashboardApp">
Text with app icon left
</EuiButtonEmpty>
</EuiFlexItem>
miukimiu marked this conversation as resolved.
Show resolved Hide resolved

<EuiFlexItem grow={false}>
<EuiButtonEmpty
color="text"
onClick={() => {}}
iconType="dashboardApp"
iconSide="right"
size="xs">
Extra small with app icon right
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
28 changes: 28 additions & 0 deletions src-docs/src/views/button/button_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,33 @@ export default () => (
/>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="m" />
<EuiTitle size="xxs">
<h3>Icons inherit by default the button color</h3>
miukimiu marked this conversation as resolved.
Show resolved Hide resolved
</EuiTitle>
<EuiSpacer size="s" />
<EuiFlexGroup responsive={false} gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiButtonIcon iconType="heart" aria-label="Heart" color="accent" />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
iconType="dashboardApp"
aria-label="Dashboard"
color="success"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
display="base"
iconType="trash"
aria-label="Delete"
color="danger"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon display="base" iconType="lensApp" aria-label="Lens" />
</EuiFlexItem>
</EuiFlexGroup>
</>
);
28 changes: 12 additions & 16 deletions src-docs/src/views/button/button_with_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,47 @@ export default () => (
<div>
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiButton onClick={() => {}} iconType="arrowUp">
<EuiButton onClick={() => {}} iconType="heart">
Primary
</EuiButton>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiButton fill iconType="arrowDown" onClick={() => {}}>
<EuiButton fill iconType="lensApp" onClick={() => {}}>
Filled
</EuiButton>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiButton iconType="arrowLeft" size="s" onClick={() => {}}>
<EuiButton iconType="heart" size="s" onClick={() => {}}>
small
</EuiButton>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiButton iconType="arrowRight" size="s" fill onClick={() => {}}>
<EuiButton iconType="lensApp" size="s" fill onClick={() => {}}>
small and filled
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>

<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiButton iconSide="right" onClick={() => {}} iconType="arrowUp">
<EuiButton iconSide="right" onClick={() => {}} iconType="heart">
Primary
</EuiButton>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiButton
iconSide="right"
fill
iconType="arrowDown"
onClick={() => {}}>
<EuiButton iconSide="right" fill iconType="lensApp" onClick={() => {}}>
Filled
</EuiButton>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiButton
iconSide="right"
iconType="arrowLeft"
iconType="heart"
size="s"
onClick={() => {}}>
small
Expand All @@ -64,7 +60,7 @@ export default () => (
<EuiFlexItem grow={false}>
<EuiButton
iconSide="right"
iconType="arrowRight"
iconType="lensApp"
size="s"
fill
onClick={() => {}}>
Expand All @@ -78,7 +74,7 @@ export default () => (
<EuiButton
iconSide="right"
onClick={() => {}}
iconType="arrowUp"
iconType="heart"
isDisabled>
Disabled
</EuiButton>
Expand All @@ -88,7 +84,7 @@ export default () => (
<EuiButton
iconSide="right"
fill
iconType="arrowDown"
iconType="lensApp"
onClick={() => {}}
isDisabled>
Filled
Expand All @@ -98,7 +94,7 @@ export default () => (
<EuiFlexItem grow={false}>
<EuiButton
iconSide="right"
iconType="arrowLeft"
iconType="heart"
size="s"
onClick={() => {}}
isDisabled>
Expand All @@ -109,7 +105,7 @@ export default () => (
<EuiFlexItem grow={false}>
<EuiButton
iconSide="right"
iconType="arrowRight"
iconType="lensApp"
size="s"
fill
onClick={() => {}}
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/call_out/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default () => (

<EuiCallOut
title="Callouts can exist as just a title. Simply omit the child content."
iconType="gear"
iconType="lensApp"
/>

<EuiSpacer size="m" />
Expand Down
16 changes: 12 additions & 4 deletions src-docs/src/views/context_menu/context_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default () => {
items: [
{
name: 'Handle an onClick',
icon: <EuiIcon type="search" size="m" />,
icon: 'search',
onClick: () => {
closePopover();
},
Expand All @@ -41,19 +41,27 @@ export default () => {
},
{
name: 'Nest panels',
icon: 'user',
icon: 'wrench',
panel: 1,
},
{
name: 'You can add a tooltip',
icon: 'user',
name: 'Add a tooltip',
icon: 'document',
toolTipTitle: 'Optional tooltip',
toolTipContent: 'Optional content for a tooltip',
toolTipPosition: 'right',
onClick: () => {
closePopover();
},
},
{
name: 'Use an app icon',
icon: 'visualizeApp',
},
{
name: 'Pass an icon as a component to customize it',
icon: <EuiIcon type="trash" size="m" color="danger" />,
},
{
name: 'Disabled option',
icon: 'user',
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/icon/icon_colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {

const iconColors = [
'default',
'inherit',
'primary',
'success',
'accent',
Expand All @@ -22,7 +23,6 @@ const iconColors = [
'text',
'subdued',
'ghost',
'#490',
'#DA8B45',
'#DDDDDD',
];
Expand Down
Loading