Skip to content

Commit

Permalink
Add new row and stack variation icons
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Mar 24, 2022
1 parent 1d40f79 commit 43a4945
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/block-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
isTemplatePart,
} from '@wordpress/blocks';
import { useSelect, useDispatch } from '@wordpress/data';
import { stack } from '@wordpress/icons';
import { copy } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down Expand Up @@ -69,7 +69,7 @@ export const BlockSwitcherDropdownMenu = ( { clientIds, blocks } ) => {
// appropriate icon to communicate the non-uniformity.
_icon = isSelectionOfSameType
? getBlockType( firstBlockName )?.icon
: stack;
: copy;
}
return {
possibleBlockTransformations: getBlockTransformItems(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useSelect } from '@wordpress/data';
import { registerBlockType, unregisterBlockType } from '@wordpress/blocks';
import { DOWN } from '@wordpress/keycodes';
import { Button } from '@wordpress/components';
import { stack } from '@wordpress/icons';
import { copy } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down Expand Up @@ -131,7 +131,7 @@ describe( 'BlockSwitcherDropdownMenu', () => {
test( 'should render disabled block switcher with multi block of different types when no transforms', () => {
useSelect.mockImplementation( () => ( {
possibleBlockTransformations: [],
icon: stack,
icon: copy,
} ) );
const wrapper = shallow(
<BlockSwitcherDropdownMenu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { sprintf, _n } from '@wordpress/i18n';
import { withSelect } from '@wordpress/data';
import { serialize } from '@wordpress/blocks';
import { count as wordCount } from '@wordpress/wordcount';
import { stack } from '@wordpress/icons';
import { copy } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -18,7 +18,7 @@ function MultiSelectionInspector( { blocks } ) {

return (
<div className="block-editor-multi-selection-inspector__card">
<BlockIcon icon={ stack } showColors />
<BlockIcon icon={ copy } showColors />
<div className="block-editor-multi-selection-inspector__card-content">
<div className="block-editor-multi-selection-inspector__card-title">
{ sprintf(
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/group/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { row, stack } from '@wordpress/icons';

const variations = [
{
Expand All @@ -22,6 +23,7 @@ const variations = [
scope: [ 'inserter', 'transform' ],
isActive: ( blockAttributes ) =>
blockAttributes.layout?.type === 'flex' && ( ! blockAttributes.layout?.orientation || blockAttributes.layout?.orientation === 'horizontal' ),
icon: row
},
{
name: 'group-stack',
Expand All @@ -31,6 +33,7 @@ const variations = [
scope: [ 'inserter', 'transform' ],
isActive: ( blockAttributes ) =>
blockAttributes.layout?.type === 'flex' && blockAttributes.layout?.orientation === 'vertical',
icon: stack,
},
];

Expand Down
4 changes: 4 additions & 0 deletions packages/icons/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

- Changed `dragHandle` footprint from 18x18 to 24x24 to match other icons. ([#39342](https://github.com/WordPress/gutenberg/pull/39342))

### New Features

- Add new `row` and `copy` icons.

## 7.0.0 (2022-02-23)

### New Features
Expand Down
2 changes: 2 additions & 0 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export { default as cog } from './library/cog';
export { default as color } from './library/color';
export { default as column } from './library/column';
export { default as columns } from './library/columns';
export { default as copy } from './library/copy';
export { default as comment } from './library/comment';
export { default as commentAuthorAvatar } from './library/comment-author-avatar';
export { default as commentAuthorName } from './library/comment-author-name';
Expand Down Expand Up @@ -185,6 +186,7 @@ export { default as replace } from './library/replace';
export { default as reset } from './library/reset';
export { default as resizeCornerNE } from './library/resize-corner-n-e';
export { default as reusableBlock } from './library/reusable-block';
export { default as row } from './library/row';
export { default as symbol } from './library/symbol';
export { default as rotateLeft } from './library/rotate-left';
export { default as rotateRight } from './library/rotate-right';
Expand Down
12 changes: 12 additions & 0 deletions packages/icons/src/library/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/primitives';

const copy = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z" />
</SVG>
);

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

const row = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M19 6.5h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zM3 8.5v7c0 1.1.9 2 2 2h3.5V16H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3.5V6.5H5c-1.1 0-2 .9-2 2z" />
</SVG>
);

export default row;

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

const stack = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z" />
</SVG>
);

export default stack;
const stack = (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M15.5 3h-7c-1.1 0-2 .9-2 2v3.5H8V5c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v3.5h1.5V5c0-1.1-.9-2-2-2zm0 7h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" />
</SVG>
);

export default stack;

0 comments on commit 43a4945

Please sign in to comment.