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

Try: Add new duotone filter icon. #40435

Merged
merged 3 commits into from
Apr 20, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { DOWN } from '@wordpress/keycodes';
import { Icon, filter } from '@wordpress/icons';

function DuotoneControl( {
colorPalette,
Expand Down Expand Up @@ -41,7 +42,13 @@ function DuotoneControl( {
aria-expanded={ isOpen }
onKeyDown={ openOnArrowDown }
label={ __( 'Apply duotone filter' ) }
icon={ <DuotoneSwatch values={ value } /> }
icon={
value ? (
<DuotoneSwatch values={ value } />
) : (
<Icon icon={ filter } />
)
}
/>
);
} }
Expand Down
3 changes: 3 additions & 0 deletions packages/icons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->

## Unreleased
### New Features

- Add new `filter` icon. ([#40435](https://github.com/WordPress/gutenberg/pull/40435))

## 8.2.0 (2022-04-08)

Expand Down
1 change: 1 addition & 0 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export { default as download } from './library/download';
export { default as edit } from './library/edit';
export { default as external } from './library/external';
export { default as file } from './library/file';
export { default as filter } from './library/filter';
export { default as flipHorizontal } from './library/flip-horizontal';
export { default as flipVertical } from './library/flip-vertical';
export { default as formatBold } from './library/format-bold';
Expand Down
12 changes: 12 additions & 0 deletions packages/icons/src/library/filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* WordPress dependencies
*/
import { Path, SVG } from '@wordpress/primitives';

const filter = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z" />
</SVG>
);

export default filter;