1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

[PM-2276] Upgrade Storybook to v7 (#5258)

This commit is contained in:
Oscar Hinton
2023-05-26 15:58:06 +02:00
committed by GitHub
parent 1638a1d6f5
commit f7b372a0b0
72 changed files with 6340 additions and 16409 deletions

View File

@@ -1,4 +1,4 @@
import { Meta, moduleMetadata, Story } from "@storybook/angular";
import { Meta, moduleMetadata, StoryObj } from "@storybook/angular";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
@@ -39,34 +39,46 @@ export default {
argTypes: {
onClose: { action: "onClose" },
},
} as Meta;
} as Meta<BannerComponent>;
const Template: Story<BannerComponent> = (args: BannerComponent) => ({
props: args,
template: `
<bit-banner [bannerType]="bannerType" (onClose)="onClose($event)">
type Story = StoryObj<BannerComponent>;
export const Premium: Story = {
args: {
bannerType: "premium",
},
render: (args: BannerComponent) => ({
props: args,
template: `
<bit-banner [bannerType]="bannerType" (onClose)="onClose($event)">
Content Really Long Text Lorem Ipsum Ipsum Ipsum
<button bitLink linkType="contrast">Button</button>
</bit-banner>
`,
});
</bit-banner>
`,
}),
};
export const Premium = Template.bind({});
Premium.args = {
bannerType: "premium",
};
export const Info = Template.bind({});
Info.args = {
bannerType: "info",
export const Info: Story = {
...Premium,
args: {
bannerType: "info",
},
};
export const Warning = Template.bind({});
Warning.args = {
bannerType: "warning",
export const Warning: Story = {
...Premium,
args: {
bannerType: "warning",
},
};
export const Danger = Template.bind({});
Danger.args = {
bannerType: "danger",
export const Danger: Story = {
...Premium,
args: {
bannerType: "danger",
},
};