diff --git a/packages/icons/src/icon/stories/index.js b/packages/icons/src/icon/stories/index.js index 9d1b2d427809c8..1cb4f2f4901b17 100644 --- a/packages/icons/src/icon/stories/index.js +++ b/packages/icons/src/icon/stories/index.js @@ -1,8 +1,3 @@ -/** - * External dependencies - */ -import { omit, omitBy, map } from 'lodash'; - /** * WordPress dependencies */ @@ -15,7 +10,7 @@ import Icon from '../'; import check from '../../library/check'; import * as icons from '../../'; -const availableIcons = omit( icons, 'Icon' ); +const { Icon: _Icon, ...availableIcons } = icons; export default { title: 'Icons/Icon', component: Icon }; @@ -42,9 +37,13 @@ export const _default = () => { const LibraryExample = () => { const [ filter, setFilter ] = useState( '' ); - const filteredIcons = omitBy( availableIcons, ( _icon, name ) => { - return name.indexOf( filter ) === -1; - } ); + const filteredIcons = filter.length + ? Object.fromEntries( + Object.entries( availableIcons ).filter( ( [ name ] ) => + name.includes( filter ) + ) + ) + : availableIcons; return (