2023-05-26 15:58:06 +02:00
|
|
|
import { Meta, StoryObj, moduleMetadata } from "@storybook/angular";
|
2022-03-08 11:50:34 +01:00
|
|
|
|
2022-06-14 17:10:53 +02:00
|
|
|
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
2022-03-08 11:50:34 +01:00
|
|
|
|
|
|
|
import { I18nMockService } from "../utils/i18n-mock.service";
|
|
|
|
|
|
|
|
import { CalloutComponent } from "./callout.component";
|
|
|
|
|
|
|
|
export default {
|
2022-06-17 16:23:04 +02:00
|
|
|
title: "Component Library/Callout",
|
2022-03-08 11:50:34 +01:00
|
|
|
component: CalloutComponent,
|
|
|
|
decorators: [
|
|
|
|
moduleMetadata({
|
|
|
|
providers: [
|
|
|
|
{
|
|
|
|
provide: I18nService,
|
|
|
|
useFactory: () => {
|
|
|
|
return new I18nMockService({
|
|
|
|
warning: "Warning",
|
|
|
|
error: "Error",
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
args: {
|
|
|
|
type: "warning",
|
|
|
|
},
|
2022-04-08 17:47:32 +02:00
|
|
|
parameters: {
|
|
|
|
design: {
|
|
|
|
type: "figma",
|
2022-10-24 19:20:38 +02:00
|
|
|
url: "https://www.figma.com/file/Zt3YSeb6E6lebAffrNLa0h/Tailwind-Component-Library?node-id=1881%3A17484",
|
2022-04-08 17:47:32 +02:00
|
|
|
},
|
|
|
|
},
|
2022-03-08 11:50:34 +01:00
|
|
|
} as Meta;
|
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
type Story = StoryObj<CalloutComponent>;
|
2022-03-08 11:50:34 +01:00
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
export const Success: Story = {
|
|
|
|
render: (args) => ({
|
|
|
|
props: args,
|
|
|
|
template: `
|
|
|
|
<bit-callout [type]="type" [title]="title">Content</bit-callout>
|
|
|
|
`,
|
|
|
|
}),
|
|
|
|
args: {
|
|
|
|
type: "success",
|
|
|
|
title: "Success",
|
|
|
|
},
|
2022-03-08 11:50:34 +01:00
|
|
|
};
|
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
export const Info: Story = {
|
|
|
|
...Success,
|
|
|
|
args: {
|
|
|
|
type: "info",
|
|
|
|
title: "Info",
|
|
|
|
},
|
2022-03-08 11:50:34 +01:00
|
|
|
};
|
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
export const Warning: Story = {
|
|
|
|
...Success,
|
|
|
|
args: {
|
|
|
|
type: "warning",
|
|
|
|
},
|
2022-03-08 11:50:34 +01:00
|
|
|
};
|
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
export const Danger: Story = {
|
|
|
|
...Success,
|
|
|
|
args: {
|
|
|
|
type: "danger",
|
|
|
|
},
|
2022-03-08 11:50:34 +01:00
|
|
|
};
|