diff --git a/libs/components/src/button/button.stories.ts b/libs/components/src/button/button.stories.ts index 3596a575640..4184ba92897 100644 --- a/libs/components/src/button/button.stories.ts +++ b/libs/components/src/button/button.stories.ts @@ -3,6 +3,8 @@ 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 { ButtonTypes } from "../shared/button-like.abstraction"; +import { TypographyModule } from "../typography"; import { I18nMockService } from "../utils/i18n-mock.service"; import { ButtonComponent } from "./button.component"; @@ -12,6 +14,7 @@ export default { component: ButtonComponent, decorators: [ moduleMetadata({ + imports: [TypographyModule], providers: [ { provide: I18nService, @@ -32,6 +35,10 @@ export default { options: ["small", "default", "large"], control: { type: "radio" }, }, + buttonType: { + options: Object.values(ButtonTypes), + control: { type: "select" }, + }, }, parameters: { design: { @@ -55,109 +62,90 @@ export const Default: Story = { }, }; -export const Primary: Story = { - ...Default, - args: { - buttonType: "primary", - }, -}; - -export const PrimaryOutline: Story = { - ...Default, - args: { - buttonType: "primaryOutline", - }, -}; - -export const PrimaryGhost: Story = { - ...Default, - args: { - buttonType: "primaryGhost", - }, -}; - -export const Subtle: Story = { - ...Default, - args: { - buttonType: "subtle", - }, -}; - -export const SubtleOutline: Story = { - ...Default, - args: { - buttonType: "subtleOutline", - }, -}; - -export const SubtleGhost: Story = { - ...Default, - args: { - buttonType: "subtleGhost", - }, -}; - -export const Danger: Story = { - ...Default, - args: { - buttonType: "danger", - }, -}; - -export const DangerOutline: Story = { - ...Default, - args: { - buttonType: "dangerOutline", - }, -}; - -export const DangerGhost: Story = { - ...Default, - args: { - buttonType: "dangerGhost", - }, -}; - -export const Warning: Story = { - ...Default, - args: { - buttonType: "warning", - }, -}; - -export const WarningOutline: Story = { - ...Default, - args: { - buttonType: "warningOutline", - }, -}; - -export const WarningGhost: Story = { - ...Default, - args: { - buttonType: "warningGhost", - }, -}; - -export const Success: Story = { - ...Default, - args: { - buttonType: "success", - }, -}; - -export const SuccessOutline: Story = { - ...Default, - args: { - buttonType: "successOutline", - }, -}; - -export const SuccessGhost: Story = { - ...Default, - args: { - buttonType: "successGhost", - }, +export const AllVariants: Story = { + render: (args) => ({ + props: args, + template: /*html*/ ` +
primary
+primaryOutline
+primaryGhost
+secondary
+subtle
+subtleOutline
+subtleGhost
+danger
+dangerOutline
+dangerGhost
+warning
+warningOutline
+warningGhost
+success
+successOutline
+successGhost
+