import { RouterTestingModule } from "@angular/router/testing"; import { Meta, StoryObj, componentWrapperDecorator, moduleMetadata } from "@storybook/angular"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CalloutModule } from "../callout"; import { NavigationModule } from "../navigation"; import { I18nMockService } from "../utils/i18n-mock.service"; import { LayoutComponent } from "./layout.component"; export default { title: "Component Library/Layout", component: LayoutComponent, decorators: [ componentWrapperDecorator( /** * Applying a CSS transform makes a `position: fixed` element act like it is `position: relative` * https://github.com/storybookjs/storybook/issues/8011#issue-490251969 */ (story) => /* HTML */ `
${story}
`, ), moduleMetadata({ imports: [NavigationModule, RouterTestingModule, CalloutModule], providers: [ { provide: I18nService, useFactory: () => { return new I18nMockService({ submenu: "submenu", toggleCollapse: "toggle collapse", }); }, }, ], }), ], } as Meta; type Story = StoryObj; export const Empty: Story = { render: (args) => ({ props: args, template: /* HTML */ ``, }), }; export const WithContent: Story = { render: (args) => ({ props: args, template: /* HTML */ ` Hello world! `, }), }; export const Secondary: Story = { render: (args) => ({ props: args, template: /* HTML */ ` Hello world! `, }), };