import { importProvidersFrom } from "@angular/core";
import { RouterModule } from "@angular/router";
import {
applicationConfig,
componentWrapperDecorator,
Meta,
moduleMetadata,
StoryObj,
} from "@storybook/angular";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import {
AvatarModule,
BreadcrumbsModule,
ButtonModule,
IconButtonModule,
IconModule,
InputModule,
MenuModule,
NavigationModule,
TabsModule,
TypographyModule,
} from "@bitwarden/components";
import { I18nMockService } from "../utils";
import { HeaderComponent } from "./header.component";
export default {
title: "Component Library/Header",
component: HeaderComponent,
decorators: [
componentWrapperDecorator(
(story) => `
${story}
`,
),
moduleMetadata({
imports: [
HeaderComponent,
AvatarModule,
BreadcrumbsModule,
ButtonModule,
IconButtonModule,
IconModule,
InputModule,
MenuModule,
NavigationModule,
TabsModule,
TypographyModule,
],
}),
applicationConfig({
providers: [
{
provide: I18nService,
useFactory: () => {
return new I18nMockService({
moreBreadcrumbs: "More breadcrumbs",
loading: "Loading",
});
},
},
importProvidersFrom(
RouterModule.forRoot(
[
{ path: "", redirectTo: "foo", pathMatch: "full" },
{ path: "foo", component: HeaderComponent },
{ path: "bar", component: HeaderComponent },
],
{ useHash: true },
),
),
],
}),
],
} as Meta;
type Story = StoryObj;
export const KitchenSink: Story = {
render: (args) => ({
props: args,
template: /*html*/ `
Foo
Bar
Foo
Bar
`,
}),
};
export const Basic: Story = {
render: (args: any) => ({
props: args,
template: /*html*/ `
`,
}),
};
export const WithLongTitle: Story = {
render: (arg: any) => ({
props: arg,
template: /*html*/ `
`,
}),
};
export const WithBreadcrumbs: Story = {
render: (args: any) => ({
props: args,
template: /*html*/ `
Foo
Bar
`,
}),
};
export const WithSearch: Story = {
render: (args: any) => ({
props: args,
template: /*html*/ `
`,
}),
};
export const WithSecondaryContent: Story = {
render: (args) => ({
props: args,
template: /*html*/ `
`,
}),
};
export const WithTabs: Story = {
render: (args) => ({
props: args,
template: /*html*/ `
Foo
Bar
`,
}),
};
export const WithTitleSuffixComponent: Story = {
render: (args) => ({
props: args,
template: /*html*/ `
`,
}),
};