2022-09-15 07:38:29 +02:00
|
|
|
import { Meta, moduleMetadata, Story } from "@storybook/angular";
|
|
|
|
|
|
|
|
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
|
|
|
|
|
|
|
import { IconButtonModule } from "../icon-button";
|
|
|
|
import { SharedModule } from "../shared/shared.module";
|
|
|
|
import { I18nMockService } from "../utils/i18n-mock.service";
|
2022-04-25 18:02:09 +02:00
|
|
|
|
|
|
|
import { BannerComponent } from "./banner.component";
|
|
|
|
|
|
|
|
export default {
|
2022-06-17 16:23:04 +02:00
|
|
|
title: "Component Library/Banner",
|
2022-04-25 18:02:09 +02:00
|
|
|
component: BannerComponent,
|
2022-09-15 07:38:29 +02:00
|
|
|
decorators: [
|
|
|
|
moduleMetadata({
|
|
|
|
imports: [SharedModule, IconButtonModule],
|
|
|
|
providers: [
|
|
|
|
{
|
|
|
|
provide: I18nService,
|
|
|
|
useFactory: () => {
|
|
|
|
return new I18nMockService({
|
|
|
|
close: "Close",
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
],
|
2022-04-25 18:02:09 +02:00
|
|
|
args: {
|
|
|
|
bannerType: "warning",
|
|
|
|
},
|
2022-09-15 07:38:29 +02:00
|
|
|
argTypes: {
|
|
|
|
onClose: { action: "onClose" },
|
|
|
|
},
|
2022-04-25 18:02:09 +02:00
|
|
|
} as Meta;
|
|
|
|
|
|
|
|
const Template: Story<BannerComponent> = (args: BannerComponent) => ({
|
|
|
|
props: args,
|
|
|
|
template: `
|
2022-10-17 20:25:55 +02:00
|
|
|
<bit-banner [bannerType]="bannerType" (onClose)="onClose($event)">
|
|
|
|
Content Really Long Text Lorem Ipsum Ipsum Ipsum
|
|
|
|
<button>Button</button>
|
|
|
|
</bit-banner>
|
2022-04-25 18:02:09 +02:00
|
|
|
`,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const Premium = Template.bind({});
|
|
|
|
Premium.args = {
|
|
|
|
bannerType: "premium",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Info = Template.bind({});
|
|
|
|
Info.args = {
|
|
|
|
bannerType: "info",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Warning = Template.bind({});
|
|
|
|
Warning.args = {
|
|
|
|
bannerType: "warning",
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Danger = Template.bind({});
|
|
|
|
Danger.args = {
|
|
|
|
bannerType: "danger",
|
|
|
|
};
|