[CL-215] Fix broken icon stories and clarify usage (#8484)

This commit is contained in:
Victoria League 2024-03-28 10:26:26 -04:00 committed by GitHub
parent bd6b3266d4
commit 65353ae71d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 17 deletions

View File

@ -1,31 +1,24 @@
import { Meta, StoryObj } from "@storybook/angular";
import { BitIconComponent } from "./icon.component";
import * as GenericIcons from "./icons";
export default {
title: "Component Library/Icon",
component: BitIconComponent,
args: {
icon: "reportExposedPasswords",
},
} as Meta;
type Story = StoryObj<BitIconComponent>;
export const ReportExposedPasswords: Story = {
render: (args) => ({
props: args,
template: `
<div class="tw-bg-primary-500 tw-p-5">
<bit-icon [icon]="icon" class="tw-text-primary-300"></bit-icon>
</div>
`,
}),
};
export const UnknownIcon: Story = {
...ReportExposedPasswords,
export const Default: Story = {
args: {
icon: "unknown" as any,
icon: GenericIcons.NoAccess,
},
argTypes: {
icon: {
options: Object.keys(GenericIcons),
mapping: GenericIcons,
control: { type: "select" },
},
},
};