diff --git a/packages/block-editor/src/components/alignment-toolbar/index.js b/packages/block-editor/src/components/alignment-toolbar/index.js
index 4f3b9104e1928a..40dfa28c0ce882 100644
--- a/packages/block-editor/src/components/alignment-toolbar/index.js
+++ b/packages/block-editor/src/components/alignment-toolbar/index.js
@@ -8,20 +8,21 @@ import { find } from 'lodash';
*/
import { __ } from '@wordpress/i18n';
import { Toolbar } from '@wordpress/components';
+import { alignLeft, alignRight, alignCenter } from '@wordpress/icons';
const DEFAULT_ALIGNMENT_CONTROLS = [
{
- icon: 'editor-alignleft',
+ icon: alignLeft,
title: __( 'Align text left' ),
align: 'left',
},
{
- icon: 'editor-aligncenter',
+ icon: alignCenter,
title: __( 'Align text center' ),
align: 'center',
},
{
- icon: 'editor-alignright',
+ icon: alignRight,
title: __( 'Align text right' ),
align: 'right',
},
diff --git a/packages/block-editor/src/components/alignment-toolbar/test/__snapshots__/index.js.snap b/packages/block-editor/src/components/alignment-toolbar/test/__snapshots__/index.js.snap
index 87dc64ceda18fe..8ca05b1361631e 100644
--- a/packages/block-editor/src/components/alignment-toolbar/test/__snapshots__/index.js.snap
+++ b/packages/block-editor/src/components/alignment-toolbar/test/__snapshots__/index.js.snap
@@ -34,7 +34,14 @@ exports[`AlignmentToolbar should match snapshot 1`] = `
Array [
Object {
"align": "left",
- "icon": "editor-alignleft",
+ "icon": ,
"isActive": true,
"onClick": [Function],
"role": "menuitemradio",
@@ -42,7 +49,14 @@ exports[`AlignmentToolbar should match snapshot 1`] = `
},
Object {
"align": "center",
- "icon": "editor-aligncenter",
+ "icon": ,
"isActive": false,
"onClick": [Function],
"role": "menuitemradio",
@@ -50,7 +64,14 @@ exports[`AlignmentToolbar should match snapshot 1`] = `
},
Object {
"align": "right",
- "icon": "editor-alignright",
+ "icon": ,
"isActive": false,
"onClick": [Function],
"role": "menuitemradio",
@@ -58,7 +79,16 @@ exports[`AlignmentToolbar should match snapshot 1`] = `
},
]
}
- icon="editor-alignleft"
+ icon={
+
+ }
isCollapsed={true}
label="Change text alignment"
/>
diff --git a/packages/block-editor/src/components/block-alignment-toolbar/index.js b/packages/block-editor/src/components/block-alignment-toolbar/index.js
index da5dbb7317a3a4..b3ac1df33142ca 100644
--- a/packages/block-editor/src/components/block-alignment-toolbar/index.js
+++ b/packages/block-editor/src/components/block-alignment-toolbar/index.js
@@ -5,6 +5,13 @@ import { __ } from '@wordpress/i18n';
import { Toolbar } from '@wordpress/components';
import { withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
+import {
+ positionCenter,
+ positionLeft,
+ positionRight,
+ stretchFullWidth,
+ stretchWide,
+} from '@wordpress/icons';
/**
* Internal dependencies
@@ -13,23 +20,23 @@ import { withBlockEditContext } from '../block-edit/context';
const BLOCK_ALIGNMENTS_CONTROLS = {
left: {
- icon: 'align-left',
+ icon: positionLeft,
title: __( 'Align left' ),
},
center: {
- icon: 'align-center',
+ icon: positionCenter,
title: __( 'Align center' ),
},
right: {
- icon: 'align-right',
+ icon: positionRight,
title: __( 'Align right' ),
},
wide: {
- icon: 'align-wide',
+ icon: stretchWide,
title: __( 'Wide width' ),
},
full: {
- icon: 'align-full-width',
+ icon: stretchFullWidth,
title: __( 'Full width' ),
},
};
@@ -43,9 +50,9 @@ export function BlockAlignmentToolbar( { value, onChange, controls = DEFAULT_CON
return () => onChange( value === align ? undefined : align );
}
- const enabledControls = wideControlsEnabled ?
- controls :
- controls.filter( ( control ) => WIDE_CONTROLS.indexOf( control ) === -1 );
+ const enabledControls = wideControlsEnabled
+ ? controls
+ : controls.filter( ( control ) => WIDE_CONTROLS.indexOf( control ) === -1 );
const activeAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[ value ];
const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[ DEFAULT_CONTROL ];
diff --git a/packages/block-editor/src/components/block-alignment-toolbar/test/__snapshots__/index.js.snap b/packages/block-editor/src/components/block-alignment-toolbar/test/__snapshots__/index.js.snap
index ebc927c8eb816b..10e88985b76d5d 100644
--- a/packages/block-editor/src/components/block-alignment-toolbar/test/__snapshots__/index.js.snap
+++ b/packages/block-editor/src/components/block-alignment-toolbar/test/__snapshots__/index.js.snap
@@ -5,21 +5,42 @@ exports[`BlockAlignmentToolbar should match snapshot 1`] = `
controls={
Array [
Object {
- "icon": "align-left",
+ "icon": ,
"isActive": true,
"onClick": [Function],
"role": "menuitemradio",
"title": "Align left",
},
Object {
- "icon": "align-center",
+ "icon": ,
"isActive": false,
"onClick": [Function],
"role": "menuitemradio",
"title": "Align center",
},
Object {
- "icon": "align-right",
+ "icon": ,
"isActive": false,
"onClick": [Function],
"role": "menuitemradio",
@@ -27,7 +48,16 @@ exports[`BlockAlignmentToolbar should match snapshot 1`] = `
},
]
}
- icon="align-left"
+ icon={
+
+ }
isCollapsed={true}
label="Change alignment"
/>
diff --git a/packages/block-editor/src/components/block-alignment-toolbar/test/index.js b/packages/block-editor/src/components/block-alignment-toolbar/test/index.js
index c7a208006849ef..b92ab806746ecf 100644
--- a/packages/block-editor/src/components/block-alignment-toolbar/test/index.js
+++ b/packages/block-editor/src/components/block-alignment-toolbar/test/index.js
@@ -25,7 +25,7 @@ describe( 'BlockAlignmentToolbar', () => {
} );
test( 'should call onChange with undefined, when the control is already active', () => {
- const activeControl = controls.find( ( { icon } ) => icon === `align-${ alignment }` );
+ const activeControl = controls.find( ( { title } ) => title === 'Align left' );
activeControl.onClick();
expect( activeControl.isActive ).toBe( true );
@@ -34,7 +34,7 @@ describe( 'BlockAlignmentToolbar', () => {
} );
test( 'should call onChange with alignment value when the control is inactive', () => {
- const inactiveCenterControl = controls.find( ( { icon } ) => icon === 'align-center' );
+ const inactiveCenterControl = controls.find( ( { title } ) => title === 'Align center' );
inactiveCenterControl.onClick();
expect( inactiveCenterControl.isActive ).toBe( false );
diff --git a/packages/block-editor/src/components/block-mobile-toolbar/index.native.js b/packages/block-editor/src/components/block-mobile-toolbar/index.native.js
index 46580878ff6843..4be16304d9937d 100644
--- a/packages/block-editor/src/components/block-mobile-toolbar/index.native.js
+++ b/packages/block-editor/src/components/block-mobile-toolbar/index.native.js
@@ -10,6 +10,7 @@ import { ToolbarButton } from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';
import { withDispatch, withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
+import { trash } from '@wordpress/icons';
/**
* Internal dependencies
@@ -39,7 +40,7 @@ const BlockMobileToolbar = ( {
)
}
onClick={ onDelete }
- icon="trash"
+ icon={ trash }
extraProps={ { hint: __( 'Double tap to remove the block' ) } }
/>
diff --git a/packages/block-editor/src/components/block-mover/icons.js b/packages/block-editor/src/components/block-mover/icons.js
index 2a15b8a6159d5d..f3b575bd57a869 100644
--- a/packages/block-editor/src/components/block-mover/icons.js
+++ b/packages/block-editor/src/components/block-mover/icons.js
@@ -1,13 +1,7 @@
/**
* WordPress dependencies
*/
-import { Path, Polygon, SVG } from '@wordpress/components';
-
-export const upArrow = (
-
-);
+import { Path, SVG } from '@wordpress/components';
export const leftArrow = (
);
-export const downArrow = (
-
-);
-
export const rightArrow = (
My Block Settings
@@ -3944,23 +3936,15 @@ exports[`Storyshots Components/Panel Multiple Bodies 1`] = `
aria-hidden="true"
className="components-panel__arrow"
focusable="false"
- height="24px"
+ height={24}
role="img"
viewBox="0 0 24 24"
- width="24px"
+ width={24}
xmlns="http://www.w3.org/2000/svg"
>
-
-
-
-
-
-
+
First Settings
@@ -3991,23 +3975,15 @@ exports[`Storyshots Components/Panel Multiple Bodies 1`] = `
aria-hidden="true"
className="components-panel__arrow"
focusable="false"
- height="24px"
+ height={24}
role="img"
viewBox="0 0 24 24"
- width="24px"
+ width={24}
xmlns="http://www.w3.org/2000/svg"
>
-
-
-
-
-
-
+
Second Settings
@@ -4047,23 +4023,15 @@ exports[`Storyshots Components/Panel With Icon 1`] = `
aria-hidden="true"
className="components-panel__arrow"
focusable="false"
- height="24px"
+ height={24}
role="img"
viewBox="0 0 24 24"
- width="24px"
+ width={24}
xmlns="http://www.w3.org/2000/svg"
>
-
-
-
-
-
-
+
My Block Settings