1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 15:23:33 +00:00

[PM-2276] Upgrade Storybook to v7 (#5258)

This commit is contained in:
Oscar Hinton
2023-05-26 15:58:06 +02:00
committed by GitHub
parent 1638a1d6f5
commit f7b372a0b0
72 changed files with 6340 additions and 16409 deletions

View File

@@ -1,5 +1,5 @@
import { CommonModule } from "@angular/common";
import { Meta, moduleMetadata, Story } from "@storybook/angular";
import { Meta, moduleMetadata, StoryObj } from "@storybook/angular";
import { BadgeDirective } from "./badge.directive";
@@ -21,43 +21,54 @@ export default {
url: "https://www.figma.com/file/Zt3YSeb6E6lebAffrNLa0h/Tailwind-Component-Library?node-id=1881%3A16956",
},
},
} as Meta;
} as Meta<BadgeDirective>;
const Template: Story<BadgeDirective> = (args: BadgeDirective) => ({
props: args,
template: `
<span class="tw-text-main">Span </span><span bitBadge [badgeType]="badgeType">Badge</span>
<br><br>
<span class="tw-text-main">Link </span><a href="#" bitBadge [badgeType]="badgeType">Badge</a>
<br><br>
<span class="tw-text-main">Button </span><button bitBadge [badgeType]="badgeType">Badge</button>
`,
});
type Story = StoryObj<BadgeDirective>;
export const Primary = Template.bind({});
Primary.args = {};
export const Secondary = Template.bind({});
Secondary.args = {
badgeType: "secondary",
export const Primary: Story = {
render: (args) => ({
props: args,
template: `
<span class="tw-text-main">Span </span><span bitBadge [badgeType]="badgeType">Badge</span>
<br><br>
<span class="tw-text-main">Link </span><a href="#" bitBadge [badgeType]="badgeType">Badge</a>
<br><br>
<span class="tw-text-main">Button </span><button bitBadge [badgeType]="badgeType">Badge</button>
`,
}),
};
export const Success = Template.bind({});
Success.args = {
badgeType: "success",
export const Secondary: Story = {
...Primary,
args: {
badgeType: "secondary",
},
};
export const Danger = Template.bind({});
Danger.args = {
badgeType: "danger",
export const Success: Story = {
...Primary,
args: {
badgeType: "success",
},
};
export const Warning = Template.bind({});
Warning.args = {
badgeType: "warning",
export const Danger: Story = {
...Primary,
args: {
badgeType: "danger",
},
};
export const Info = Template.bind({});
Info.args = {
badgeType: "info",
export const Warning: Story = {
...Primary,
args: {
badgeType: "warning",
},
};
export const Info: Story = {
...Primary,
args: {
badgeType: "info",
},
};