import { RouterTestingModule } from "@angular/router/testing"; import { StoryObj, Meta, moduleMetadata } from "@storybook/angular"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { IconButtonModule } from "../icon-button"; import { LayoutComponent } from "../layout"; import { positionFixedWrapperDecorator } from "../stories/storybook-decorators"; import { I18nMockService } from "../utils/i18n-mock.service"; import { NavItemComponent } from "./nav-item.component"; import { NavigationModule } from "./navigation.module"; export default { title: "Component Library/Nav/Nav Item", component: NavItemComponent, decorators: [ positionFixedWrapperDecorator( (story) => `${story}`, ), moduleMetadata({ declarations: [], imports: [RouterTestingModule, IconButtonModule, NavigationModule, LayoutComponent], providers: [ { provide: I18nService, useFactory: () => { return new I18nMockService({ submenu: "submenu", toggleCollapse: "toggle collapse", toggleSideNavigation: "Toggle side navigation", skipToContent: "Skip to content", }); }, }, ], }), ], parameters: { design: { type: "figma", url: "https://www.figma.com/design/Zt3YSeb6E6lebAffrNLa0h/Tailwind-Component-Library?node-id=16329-40145&t=b5tDKylm5sWm2yKo-4", }, chromatic: { viewports: [640, 1280] }, }, } as Meta; type Story = StoryObj; export const Default: Story = { render: (args) => ({ props: args, template: ` `, }), args: { text: "Hello World", icon: "bwi-filter", }, }; export const WithoutIcon: Story = { ...Default, args: { text: "Hello World", icon: "", }, }; export const WithLongText: Story = { ...Default, args: { text: "Hello World This Is a Cool Item", }, }; export const WithoutRoute: Story = { render: () => ({ template: ` `, }), }; export const WithChildButtons: Story = { render: (args) => ({ props: args, template: ` `, }), }; export const MultipleItemsWithDivider: Story = { render: (args) => ({ props: args, template: ` `, }), }; export const ForceActiveStyles: Story = { render: (args) => ({ props: args, template: ` `, }), };