Skip to content

Commit

Permalink
Move more block icons to the icons library
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jan 24, 2020
1 parent b9b1818 commit c7c67bf
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/block-library/src/heading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { isEmpty } from 'lodash';
/**
* WordPress dependencies
*/
import { heading as icon } from '@wordpress/icons';
import { __, sprintf } from '@wordpress/i18n';

/**
Expand All @@ -24,7 +25,7 @@ export { metadata, name };
export const settings = {
title: __( 'Heading' ),
description: __( 'Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.' ),
icon: 'heading',
icon,
keywords: [ __( 'title' ), __( 'subtitle' ) ],
supports: {
className: false,
Expand Down
5 changes: 3 additions & 2 deletions packages/block-library/src/navigation-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Path, SVG } from '@wordpress/components';
import { navigation as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
Expand All @@ -18,7 +19,7 @@ export const settings = {

parent: [ 'core/navigation' ],

icon: <SVG xmlns="http://www.w3.org/2000/svg" width="24" height="24"><Path d="M12 7.27l4.28 10.43-3.47-1.53-.81-.36-.81.36-3.47 1.53L12 7.27M12 2L4.5 20.29l.71.71L12 18l6.79 3 .71-.71L12 2z" /></SVG>,
icon,

description: __( 'Add a page, link, or another item to your navigation.' ),

Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { menu as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -14,7 +15,7 @@ export const name = 'core/navigation';
export const settings = {
title: __( 'Navigation' ),

icon: 'menu',
icon,

description: __( 'Add a navigation block to your site.' ),

Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/rss/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { rss as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -13,7 +14,7 @@ export const name = 'core/rss';
export const settings = {
title: __( 'RSS' ),
description: __( 'Display entries from any RSS or Atom feed.' ),
icon: 'rss',
icon,
category: 'widgets',
keywords: [ __( 'atom' ), __( 'feed' ) ],
supports: {
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { search as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -13,7 +14,7 @@ export const name = 'core/search';
export const settings = {
title: __( 'Search' ),
description: __( 'Help visitors find your content.' ),
icon: 'search',
icon,
category: 'widgets',
keywords: [ __( 'find' ) ],
supports: {
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/tag-cloud/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { tag as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -13,7 +14,7 @@ export const name = 'core/tag-cloud';
export const settings = {
title: __( 'Tag Cloud' ),
description: __( 'A cloud of your most used tags.' ),
icon: 'tag',
icon,
category: 'widgets',
supports: {
html: false,
Expand Down
6 changes: 6 additions & 0 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,28 @@ export { default as cover } from './library/cover';
export { default as file } from './library/file';
export { default as gallery } from './library/gallery';
export { default as group } from './library/group';
export { default as heading } from './library/heading';
export { default as html } from './library/html';
export { default as image } from './library/image';
export { default as list } from './library/list';
export { default as mapMarker } from './library/map-marker';
export { default as mediaAndText } from './library/media-and-text';
export { default as menu } from './library/menu';
export { default as more } from './library/more';
export { default as navigation } from './library/navigation';
export { default as pageBreak } from './library/page-break';
export { default as paragraph } from './library/paragraph';
export { default as postList } from './library/post-list';
export { default as preformatted } from './library/preformatted';
export { default as pullquote } from './library/pullquote';
export { default as quote } from './library/quote';
export { default as resizeCornerNE } from './library/resize-corner-n-e';
export { default as rss } from './library/rss';
export { default as search } from './library/search';
export { default as separator } from './library/separator';
export { default as shortcode } from './library/shortcode';
export { default as table } from './library/table';
export { default as tag } from './library/tag';
export { default as title } from './library/title';
export { default as verse } from './library/verse';
export { default as video } from './library/video';
Expand Down
13 changes: 13 additions & 0 deletions packages/icons/src/library/heading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';

const heading = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M12.5 4v5.2h-5V4H5v13h2.5v-5.2h5V17H15V4" />
</SVG>
);

export default heading;

13 changes: 13 additions & 0 deletions packages/icons/src/library/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';

const menu = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M17 7V5H3v2h14zm0 4V9H3v2h14zm0 4v-2H3v2h14z" />
</SVG>
);

export default menu;

12 changes: 12 additions & 0 deletions packages/icons/src/library/navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';

const navigation = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Path d="M12 7.27l4.28 10.43-3.47-1.53-.81-.36-.81.36-3.47 1.53L12 7.27M12 2L4.5 20.29l.71.71L12 18l6.79 3 .71-.71L12 2z" />
</SVG>
);

export default navigation;
13 changes: 13 additions & 0 deletions packages/icons/src/library/rss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';

const rss = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M14.92 18H18C18 9.32 10.82 2.25 2 2.25v3.02c7.12 0 12.92 5.71 12.92 12.73zm-5.44 0h3.08C12.56 12.27 7.82 7.6 2 7.6v3.02c2 0 3.87.77 5.29 2.16C8.7 14.17 9.48 16.03 9.48 18zm-5.35-.02c1.17 0 2.13-.93 2.13-2.09 0-1.15-.96-2.09-2.13-2.09-1.18 0-2.13.94-2.13 2.09 0 1.16.95 2.09 2.13 2.09z" />
</SVG>
);

export default rss;

13 changes: 13 additions & 0 deletions packages/icons/src/library/search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';

const search = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M12.14 4.18c1.87 1.87 2.11 4.75.72 6.89.12.1.22.21.36.31.2.16.47.36.81.59.34.24.56.39.66.47.42.31.73.57.94.78.32.32.6.65.84 1 .25.35.44.69.59 1.04.14.35.21.68.18 1-.02.32-.14.59-.36.81s-.49.34-.81.36c-.31.02-.65-.04-.99-.19-.35-.14-.7-.34-1.04-.59-.35-.24-.68-.52-1-.84-.21-.21-.47-.52-.77-.93-.1-.13-.25-.35-.47-.66-.22-.32-.4-.57-.56-.78-.16-.2-.29-.35-.44-.5-2.07 1.09-4.69.76-6.44-.98-2.14-2.15-2.14-5.64 0-7.78 2.15-2.15 5.63-2.15 7.78 0zm-1.41 6.36c1.36-1.37 1.36-3.58 0-4.95-1.37-1.37-3.59-1.37-4.95 0-1.37 1.37-1.37 3.58 0 4.95 1.36 1.37 3.58 1.37 4.95 0z" />
</SVG>
);

export default search;

13 changes: 13 additions & 0 deletions packages/icons/src/library/tag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';

const tag = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M11 2h7v7L8 19l-7-7zm3 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" />
</SVG>
);

export default tag;

0 comments on commit c7c67bf

Please sign in to comment.