From fa03696b8466d0e5ea7d04cc6c413c7b76f082f2 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 22 Jan 2020 10:06:30 +0100 Subject: [PATCH] Move a dozen of block icons to the icons package --- packages/block-library/src/archives/icon.js | 8 ------- packages/block-library/src/archives/index.js | 2 +- packages/block-library/src/audio/edit.js | 6 +---- packages/block-library/src/audio/icon.js | 6 ----- packages/block-library/src/audio/index.js | 2 +- packages/block-library/src/button/icon.js | 8 ------- packages/block-library/src/button/index.js | 2 +- packages/block-library/src/buttons/index.js | 2 +- packages/block-library/src/calendar/index.js | 2 +- packages/block-library/src/categories/icon.js | 8 ------- .../block-library/src/categories/index.js | 2 +- packages/block-library/src/classic/icon.js | 8 ------- packages/block-library/src/classic/index.js | 2 +- packages/block-library/src/code/index.js | 2 +- packages/icons/src/index.js | 7 ++++++ packages/icons/src/library/archive.js | 12 ++++++++++ packages/icons/src/library/audio.js | 13 ++++++++++ packages/icons/src/library/button.js | 15 ++++++++++++ packages/icons/src/library/calendar.js | 15 ++++++++++++ packages/icons/src/library/category.js | 15 ++++++++++++ packages/icons/src/library/classic.js | 24 +++++++++++++++++++ packages/icons/src/library/code.js | 13 ++++++++++ 22 files changed, 123 insertions(+), 51 deletions(-) delete mode 100644 packages/block-library/src/archives/icon.js delete mode 100644 packages/block-library/src/audio/icon.js delete mode 100644 packages/block-library/src/button/icon.js delete mode 100644 packages/block-library/src/categories/icon.js delete mode 100644 packages/block-library/src/classic/icon.js create mode 100644 packages/icons/src/library/archive.js create mode 100644 packages/icons/src/library/audio.js create mode 100644 packages/icons/src/library/button.js create mode 100644 packages/icons/src/library/calendar.js create mode 100644 packages/icons/src/library/category.js create mode 100644 packages/icons/src/library/classic.js create mode 100644 packages/icons/src/library/code.js diff --git a/packages/block-library/src/archives/icon.js b/packages/block-library/src/archives/icon.js deleted file mode 100644 index 074a16c79458fc..00000000000000 --- a/packages/block-library/src/archives/icon.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * WordPress dependencies - */ -import { Path, SVG } from '@wordpress/components'; - -export default ( - -); diff --git a/packages/block-library/src/archives/index.js b/packages/block-library/src/archives/index.js index aa4c172ddedf68..ef8f1c484d15dc 100644 --- a/packages/block-library/src/archives/index.js +++ b/packages/block-library/src/archives/index.js @@ -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'; diff --git a/packages/block-library/src/audio/edit.js b/packages/block-library/src/audio/edit.js index 33c5828990eb33..a87bfb98db05bb 100644 --- a/packages/block-library/src/audio/edit.js +++ b/packages/block-library/src/audio/edit.js @@ -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 diff --git a/packages/block-library/src/audio/icon.js b/packages/block-library/src/audio/icon.js deleted file mode 100644 index 4b871506bf4788..00000000000000 --- a/packages/block-library/src/audio/icon.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * WordPress dependencies - */ -import { Path, SVG } from '@wordpress/components'; - -export default ; diff --git a/packages/block-library/src/audio/index.js b/packages/block-library/src/audio/index.js index 63013808a0439b..9e7e414f93c176 100644 --- a/packages/block-library/src/audio/index.js +++ b/packages/block-library/src/audio/index.js @@ -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'; diff --git a/packages/block-library/src/button/icon.js b/packages/block-library/src/button/icon.js deleted file mode 100644 index 6e18a60a648fe3..00000000000000 --- a/packages/block-library/src/button/icon.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * WordPress dependencies - */ -import { G, Path, SVG } from '@wordpress/components'; - -export default ( - -); diff --git a/packages/block-library/src/button/index.js b/packages/block-library/src/button/index.js index 28c2e483ed1141..ec32d4989ad022 100644 --- a/packages/block-library/src/button/index.js +++ b/packages/block-library/src/button/index.js @@ -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'; diff --git a/packages/block-library/src/buttons/index.js b/packages/block-library/src/buttons/index.js index 5bc16c94b15368..719c0949152660 100644 --- a/packages/block-library/src/buttons/index.js +++ b/packages/block-library/src/buttons/index.js @@ -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'; diff --git a/packages/block-library/src/calendar/index.js b/packages/block-library/src/calendar/index.js index b63eb51188afe1..e49460b0ebafe5 100644 --- a/packages/block-library/src/calendar/index.js +++ b/packages/block-library/src/calendar/index.js @@ -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'; diff --git a/packages/block-library/src/categories/icon.js b/packages/block-library/src/categories/icon.js deleted file mode 100644 index fb89fbd4ce1a13..00000000000000 --- a/packages/block-library/src/categories/icon.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * WordPress dependencies - */ -import { SVG, Path } from '@wordpress/components'; - -export default ( - -); diff --git a/packages/block-library/src/categories/index.js b/packages/block-library/src/categories/index.js index 109b5ae0d10cb5..42b863d5c87458 100644 --- a/packages/block-library/src/categories/index.js +++ b/packages/block-library/src/categories/index.js @@ -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'; diff --git a/packages/block-library/src/classic/icon.js b/packages/block-library/src/classic/icon.js deleted file mode 100644 index 4193982d2aa449..00000000000000 --- a/packages/block-library/src/classic/icon.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * WordPress dependencies - */ -import { Path, Rect, SVG } from '@wordpress/components'; - -export default ( - -); diff --git a/packages/block-library/src/classic/index.js b/packages/block-library/src/classic/index.js index dc1f63a01e8b0e..45ef275a3c79f9 100644 --- a/packages/block-library/src/classic/index.js +++ b/packages/block-library/src/classic/index.js @@ -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'; diff --git a/packages/block-library/src/code/index.js b/packages/block-library/src/code/index.js index f258d7b972dd9f..7ab1b268a9a997 100644 --- a/packages/block-library/src/code/index.js +++ b/packages/block-library/src/code/index.js @@ -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'; diff --git a/packages/icons/src/index.js b/packages/icons/src/index.js index b3b5316dc9a050..1b6b65f727ba43 100644 --- a/packages/icons/src/index.js +++ b/packages/icons/src/index.js @@ -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'; diff --git a/packages/icons/src/library/archive.js b/packages/icons/src/library/archive.js new file mode 100644 index 00000000000000..08f4725dbf5c6c --- /dev/null +++ b/packages/icons/src/library/archive.js @@ -0,0 +1,12 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const archive = ( + + + +); + +export default archive; diff --git a/packages/icons/src/library/audio.js b/packages/icons/src/library/audio.js new file mode 100644 index 00000000000000..ba6e55a2e45587 --- /dev/null +++ b/packages/icons/src/library/audio.js @@ -0,0 +1,13 @@ +/** + * WordPress dependencies + */ +import { Path, SVG } from '@wordpress/primitives'; + +const audio = ( + + + + +); + +export default audio; diff --git a/packages/icons/src/library/button.js b/packages/icons/src/library/button.js new file mode 100644 index 00000000000000..3498abf1b31040 --- /dev/null +++ b/packages/icons/src/library/button.js @@ -0,0 +1,15 @@ +/** + * WordPress dependencies + */ +import { G, Path, SVG } from '@wordpress/primitives'; + +const button = ( + + + + + + +); + +export default button; diff --git a/packages/icons/src/library/calendar.js b/packages/icons/src/library/calendar.js new file mode 100644 index 00000000000000..85728b70afc848 --- /dev/null +++ b/packages/icons/src/library/calendar.js @@ -0,0 +1,15 @@ +/** + * WordPress dependencies + */ +import { G, Path, SVG } from '@wordpress/primitives'; + +const calendar = ( + + + + + + +); + +export default calendar; diff --git a/packages/icons/src/library/category.js b/packages/icons/src/library/category.js new file mode 100644 index 00000000000000..47ae2af7595f0b --- /dev/null +++ b/packages/icons/src/library/category.js @@ -0,0 +1,15 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const category = ( + + + + + + +); + +export default category; diff --git a/packages/icons/src/library/classic.js b/packages/icons/src/library/classic.js new file mode 100644 index 00000000000000..d716d6619cf69f --- /dev/null +++ b/packages/icons/src/library/classic.js @@ -0,0 +1,24 @@ +/** + * WordPress dependencies + */ +import { Path, Rect, SVG } from '@wordpress/primitives'; + +const classic = ( + + + + + + + + + + + + + + + +); + +export default classic; diff --git a/packages/icons/src/library/code.js b/packages/icons/src/library/code.js new file mode 100644 index 00000000000000..dc84ba2d26affc --- /dev/null +++ b/packages/icons/src/library/code.js @@ -0,0 +1,13 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const code = ( + + + + +); + +export default code;