mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +00:00
[CL-215] Fix broken icon stories and clarify usage (#8484)
This commit is contained in:
@@ -1,31 +1,24 @@
|
|||||||
import { Meta, StoryObj } from "@storybook/angular";
|
import { Meta, StoryObj } from "@storybook/angular";
|
||||||
|
|
||||||
import { BitIconComponent } from "./icon.component";
|
import { BitIconComponent } from "./icon.component";
|
||||||
|
import * as GenericIcons from "./icons";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Component Library/Icon",
|
title: "Component Library/Icon",
|
||||||
component: BitIconComponent,
|
component: BitIconComponent,
|
||||||
args: {
|
|
||||||
icon: "reportExposedPasswords",
|
|
||||||
},
|
|
||||||
} as Meta;
|
} as Meta;
|
||||||
|
|
||||||
type Story = StoryObj<BitIconComponent>;
|
type Story = StoryObj<BitIconComponent>;
|
||||||
|
|
||||||
export const ReportExposedPasswords: Story = {
|
export const Default: 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,
|
|
||||||
args: {
|
args: {
|
||||||
icon: "unknown" as any,
|
icon: GenericIcons.NoAccess,
|
||||||
|
},
|
||||||
|
argTypes: {
|
||||||
|
icon: {
|
||||||
|
options: Object.keys(GenericIcons),
|
||||||
|
mapping: GenericIcons,
|
||||||
|
control: { type: "select" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user