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

Move a dozen of block icons to the icons package #19808

Merged
merged 3 commits into from
Jan 23, 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
8 changes: 0 additions & 8 deletions packages/block-library/src/archives/icon.js

This file was deleted.

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

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';

export const name = 'core/archives';

Expand Down
6 changes: 1 addition & 5 deletions packages/block-library/src/audio/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ import {
import { Component } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { withSelect } from '@wordpress/data';

/**
* Internal dependencies
*/
import icon from './icon';
import { audio as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down
6 changes: 0 additions & 6 deletions packages/block-library/src/audio/icon.js

This file was deleted.

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

/**
* Internal dependencies
*/
import deprecated from './deprecated';
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/button/icon.js

This file was deleted.

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

/**
* Internal dependencies
*/
import deprecated from './deprecated';
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';

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

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';

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

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';

export const name = 'core/calendar';

Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/categories/icon.js

This file was deleted.

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

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';

export const name = 'core/categories';

Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/classic/icon.js

This file was deleted.

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

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';

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

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand Down
7 changes: 7 additions & 0 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
export { default as __experimentalIcon } from './icon';

export { default as archive } from './library/archive';
export { default as audio } from './library/audio';
export { default as button } from './library/button';
export { default as check } from './library/check';
export { default as calendar } from './library/calendar';
export { default as category } from './library/category';
export { default as classic } from './library/classic';
export { default as code } from './library/code';
export { default as paragraph } from './library/paragraph';
12 changes: 12 additions & 0 deletions packages/icons/src/library/archive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';

const archive = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Path d="M21 6V20C21 21.1 20.1 22 19 22H5C3.89 22 3 21.1 3 20L3.01 6C3.01 4.9 3.89 4 5 4H6V2H8V4H16V2H18V4H19C20.1 4 21 4.9 21 6ZM5 8H19V6H5V8ZM19 20V10H5V20H19ZM11 12H17V14H11V12ZM17 16H11V18H17V16ZM7 12H9V14H7V12ZM9 18V16H7V18H9Z" />
</SVG>
);

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

const audio = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Path d="m12 3l0.01 10.55c-0.59-0.34-1.27-0.55-2-0.55-2.22 0-4.01 1.79-4.01 4s1.79 4 4.01 4 3.99-1.79 3.99-4v-10h4v-4h-6zm-1.99 16c-1.1 0-2-0.9-2-2s0.9-2 2-2 2 0.9 2 2-0.9 2-2 2z" />
</SVG>
);

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

const button = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Path d="M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z" />
</SVG>
);

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

const calendar = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Path d="M7 11h2v2H7v-2zm14-5v14c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2l.01-14c0-1.1.88-2 1.99-2h1V2h2v2h8V2h2v2h1c1.1 0 2 .9 2 2zM5 8h14V6H5v2zm14 12V10H5v10h14zm-4-7h2v-2h-2v2zm-4 0h2v-2h-2v2z" />
</SVG>
);

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

const category = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Path d="M12,2l-5.5,9h11L12,2z M12,5.84L13.93,9h-3.87L12,5.84z" />
<Path d="m17.5 13c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5zm0 7c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" />
<Path d="m3 21.5h8v-8h-8v8zm2-6h4v4h-4v-4z" />
</SVG>
);

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

const classic = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Path d="m20 7v10h-16v-10h16m0-2h-16c-1.1 0-1.99 0.9-1.99 2l-0.01 10c0 1.1 0.9 2 2 2h16c1.1 0 2-0.9 2-2v-10c0-1.1-0.9-2-2-2z" />
<Rect x="11" y="8" width="2" height="2" />
<Rect x="11" y="11" width="2" height="2" />
<Rect x="8" y="8" width="2" height="2" />
<Rect x="8" y="11" width="2" height="2" />
<Rect x="5" y="11" width="2" height="2" />
<Rect x="5" y="8" width="2" height="2" />
<Rect x="8" y="14" width="8" height="2" />
<Rect x="14" y="11" width="2" height="2" />
<Rect x="14" y="8" width="2" height="2" />
<Rect x="17" y="11" width="2" height="2" />
<Rect x="17" y="8" width="2" height="2" />
</SVG>
);

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

const code = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Path d="M9.4,16.6L4.8,12l4.6-4.6L8,6l-6,6l6,6L9.4,16.6z M14.6,16.6l4.6-4.6l-4.6-4.6L16,6l6,6l-6,6L14.6,16.6z" />
</SVG>
);

export default code;