Skip to content

Commit

Permalink
Move more block icons to the icons package (#19838)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Jan 24, 2020
1 parent 167d4d1 commit b9b1818
Show file tree
Hide file tree
Showing 40 changed files with 162 additions and 107 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-content/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 { alignJustify as icon } from '@wordpress/icons';

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

const { name } = metadata;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-title/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 { title as icon } from '@wordpress/icons';

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

const { name } = metadata;
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/preformatted/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/preformatted/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 { preformatted 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
8 changes: 0 additions & 8 deletions packages/block-library/src/pullquote/icon.js

This file was deleted.

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

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

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

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/quote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* WordPress dependencies
*/
import { __, _x } from '@wordpress/i18n';
import { quote 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/separator/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/separator/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 { separator 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
8 changes: 0 additions & 8 deletions packages/block-library/src/shortcode/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/shortcode/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 { shortcode as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import save from './save';
import transforms from './transforms';
import metadata from './block.json';
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/site-title/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 { mapMarker as icon } from '@wordpress/icons';

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

const { name } = metadata;
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/spacer/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/spacer/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 { resizeCornerNE 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
8 changes: 0 additions & 8 deletions packages/block-library/src/subhead/icon.js

This file was deleted.

8 changes: 6 additions & 2 deletions packages/block-library/src/subhead/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 { SVG, Path } from '@wordpress/components';

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand All @@ -19,7 +19,11 @@ export { metadata, name };
export const settings = {
title: __( 'Subheading (deprecated)' ),
description: __( 'This block is deprecated. Please use the Paragraph block instead.' ),
icon,
icon: (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M7.1 6l-.5 3h4.5L9.4 19h3l1.8-10h4.5l.5-3H7.1z" />
</SVG>
),
supports: {
// Hide from inserter as this block is deprecated.
inserter: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/table/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
ToggleControl,
ToolbarGroup,
} from '@wordpress/components';
import { table as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -41,7 +42,6 @@ import {
toggleSection,
isEmptyTableSection,
} from './state';
import icon from './icon';

const BACKGROUND_COLORS = [
{
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/table/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* WordPress dependencies
*/
import { __, _x } from '@wordpress/i18n';
import { table 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/verse/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/verse/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 { verse 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
2 changes: 1 addition & 1 deletion packages/block-library/src/video/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import {
import {
withSelect,
} from '@wordpress/data';
import { video as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import { createUpgradedEmbedBlock } from '../embed/util';
import icon from './icon';
import VideoCommonSettings from './edit-common-settings';

const ALLOWED_MEDIA_TYPES = [ 'video' ];
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/video/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ import {
import { __, sprintf } from '@wordpress/i18n';
import { isURL } from '@wordpress/url';
import { doAction, hasAction } from '@wordpress/hooks';
import { video as SvgIcon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import style from './style.scss';
import SvgIcon from './icon';
import SvgIconRetry from './icon-retry';
import VideoCommonSettings from './edit-common-settings';

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

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/video/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 { video 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
12 changes: 12 additions & 0 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { default as Icon } from './icon';

export { default as alignJustify } from './library/align-justify';
export { default as archive } from './library/archive';
export { default as audio } from './library/audio';
export { default as button } from './library/button';
Expand All @@ -18,9 +19,20 @@ export { default as group } from './library/group';
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 more } from './library/more';
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 separator } from './library/separator';
export { default as shortcode } from './library/shortcode';
export { default as table } from './library/table';
export { default as title } from './library/title';
export { default as verse } from './library/verse';
export { default as video } from './library/video';
export { default as widget } from './library/widget';
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/components';
import { SVG, Path } from '@wordpress/primitives';

export default (
const alignJustify = (
<SVG xmlns="https://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path fill="none" d="M0 0h24v24H0V0z" />
<Path d="M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z" />
</SVG>
);

export default alignJustify;
4 changes: 2 additions & 2 deletions packages/icons/src/library/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const saved = (
const check = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2" />
</SVG>
);

export default saved;
export default check;

Loading

0 comments on commit b9b1818

Please sign in to comment.