New all-icons helper that's really only meant for development use

This returns an array of all icons. As the comment suggests, it's
because the SVGs file can't be imported in stories since it is generated
as part of the Ember project.
This commit is contained in:
Michael Lange 2020-10-26 12:25:34 -07:00
parent 35ceca7f62
commit 8fe5c55594
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
import { helper } from '@ember/component/helper';
// Generated at compile-time by ember-inline-svg
import SVGs from '../svgs';
/**
* Icons array
*
* Usage: {{#each (all-icons) as |icon|}}
*
* Returns the array of all icon strings available to {{x-icon}}. This is a bit of a hack
* since the above SVGs import isn't available in the Storybook context.
*/
export function allIcons() {
return Object.keys(SVGs);
}
export default helper(allIcons);