import { Meta, StoryObj, moduleMetadata } from "@storybook/angular"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { ButtonModule } from "../button"; import { IconButtonModule } from "../icon-button"; import { SharedModule } from "../shared/shared.module"; import { I18nMockService } from "../utils/i18n-mock.service"; import { PopoverTriggerForDirective } from "./popover-trigger-for.directive"; import { PopoverModule } from "./popover.module"; export default { title: "Component Library/Popover", decorators: [ moduleMetadata({ imports: [PopoverModule, ButtonModule, IconButtonModule, SharedModule], providers: [ { provide: I18nService, useFactory: () => { return new I18nMockService({ close: "Close", }); }, }, ], }), ], parameters: { design: { type: "figma", url: "https://www.figma.com/file/Zt3YSeb6E6lebAffrNLa0h/Tailwind-Component-Library?node-id=1717-15868", }, }, argTypes: { position: { options: [ "right-start", "right-center", "right-end", "left-start", "left-center", "left-end", "below-start", "below-center", "below-end", "above-start", "above-center", "above-end", ], control: { type: "select" }, }, }, args: { position: "right-start", }, } as Meta; type Story = StoryObj; const popoverContent = `
Lorem ipsum dolor adipisicing elit.
`; export const Default: Story = { render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const Open: Story = { render: (args) => ({ props: args, template: `
Lorem ipsum dolor adipisicing elit.
`, }), }; export const InitiallyOpen: Story = { render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const RightStart: Story = { args: { position: "right-start", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const RightCenter: Story = { args: { position: "right-center", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const RightEnd: Story = { args: { position: "right-end", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const LeftStart: Story = { args: { position: "left-start", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const LeftCenter: Story = { args: { position: "left-center", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const LeftEnd: Story = { args: { position: "left-end", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const BelowStart: Story = { args: { position: "below-start", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const BelowCenter: Story = { args: { position: "below-center", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const BelowEnd: Story = { args: { position: "below-end", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const AboveStart: Story = { args: { position: "above-start", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const AboveCenter: Story = { args: { position: "above-center", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), }; export const AboveEnd: Story = { args: { position: "above-end", }, render: (args) => ({ props: args, template: `
${popoverContent} `, }), };