import { Meta, moduleMetadata, StoryObj } from "@storybook/angular"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { formatArgsForCodeSnippet } from "../../../../.storybook/format-args-for-code-snippet"; import { I18nMockService } from "../utils"; import { BitIconButtonComponent } from "./icon-button.component"; export default { title: "Component Library/Icon Button", component: BitIconButtonComponent, decorators: [ moduleMetadata({ providers: [ { provide: I18nService, useFactory: () => { return new I18nMockService({ loading: "Loading", }); }, }, ], }), ], args: { bitIconButton: "bwi-plus", label: "Your button label here", }, argTypes: { buttonType: { options: ["primary", "secondary", "danger", "unstyled", "contrast", "main", "muted", "light"], }, }, parameters: { design: { type: "figma", url: "https://www.figma.com/design/Zt3YSeb6E6lebAffrNLa0h/Tailwind-Component-Library?node-id=16329-37011&t=b5tDKylm5sWm2yKo-4", }, }, } as Meta; type Story = StoryObj; export const Default: Story = { render: (args) => ({ props: args, template: /*html*/ ` `, }), }; export const Small: Story = { ...Default, args: { size: "small", buttonType: "primary", }, }; export const Primary: Story = { ...Default, args: { buttonType: "primary", }, }; export const Danger: Story = { ...Default, args: { buttonType: "danger", }, }; export const Main: Story = { ...Default, args: { buttonType: "main", }, }; export const Muted: Story = { ...Default, args: { buttonType: "muted", }, }; export const NavContrast: Story = { render: (args) => ({ props: args, template: /*html*/ `
`, }), args: { buttonType: "nav-contrast", }, }; export const Contrast: Story = { render: (args) => ({ props: args, template: /*html*/ `
`, }), args: { buttonType: "contrast", }, }; export const Loading: Story = { ...Default, args: { disabled: false, loading: true, }, }; export const Disabled: Story = { ...Default, args: { disabled: true, loading: false, }, };