Skip to content

Commit

Permalink
feat(icons): add all icons in story
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelB committed Oct 8, 2024
1 parent d7e3bfd commit bb4afd3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/stories/pix-icon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import * as ComponentStories from './pix-icon.stories';

> Permet d'utiliser les icônes disponible du Design System.
<Story of={ComponentStories.icon} height={60} />
<Story of={ComponentStories.allIcons} height={300} />

## Usage

```html
<PixIcon @name="powerSettings", @plainIcon={{true}} />
<PixIcon @name="powerSettings" , @plainIcon="{{true}}" />
```

## Arguments
Expand Down
28 changes: 28 additions & 0 deletions app/stories/pix-icon.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,31 @@ export const icon = (args) => ({
/>`,
context: args,
});

const icons = Object.entries(ICONS).flatMap(([name, icon]) =>
icon.plainIcon
? [
{ iconName: name, variant: false },
{ iconName: name, variant: true },
]
: { iconName: name, variant: false },
);

export const allIcons = (args) => {
return {
template: hbs`
<ul>
{{#each args.icons as |icon| }}
<li>
<PixIcon @name={{icon.iconName}} @plainIcon={{icon.variant}} @alternativeText={{icon.iconName}} @ariaHidden={{true}} />
<span>{{icon.iconName}}</span>
</li>
{{/each}}
</ul>
`,
context: args,
};
};

allIcons.bind({});
allIcons.args = { icons };

0 comments on commit bb4afd3

Please sign in to comment.