Skip to content

Commit

Permalink
Migrate storybook from v7.6.15 to v8.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian702 committed Jun 19, 2024
1 parent 60cff85 commit b468c61
Show file tree
Hide file tree
Showing 45 changed files with 3,121 additions and 2,863 deletions.
8 changes: 5 additions & 3 deletions frontend/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const config: StorybookConfig = {
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-a11y",
"@chromatic-com/storybook",
],
async babel(config) {
config.plugins?.push("macros");
Expand All @@ -31,9 +32,10 @@ const config: StorybookConfig = {
name: "@storybook/nextjs",
options: {},
},
docs: {
autodocs: "tag",
},
staticDirs: ["../public"],
typescript: {
reactDocgen: "react-docgen",
},
docs: {},
};
export default config;
2 changes: 1 addition & 1 deletion frontend/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const preview = {
},
mswDecorator,
],
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down Expand Up @@ -65,5 +64,6 @@ export const preview = {
},
},
},
tags: ["autodocs"],
};
export default preview;
1 change: 0 additions & 1 deletion frontend/components/Text.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Text } from "@/components/Text";
const meta: Meta<typeof Text> = {
title: "Components/Text",
component: Text,
tags: ["autodocs"],
args: {},
};

Expand Down
1 change: 0 additions & 1 deletion frontend/components/deck/Deck.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Deck } from "@/components/deck/Deck";
const meta: Meta<typeof Deck> = {
title: "Components/Deck",
component: Deck,
tags: ["autodocs"],
args: {},
};

Expand Down
15 changes: 2 additions & 13 deletions frontend/components/flashcard/Card.stories.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { Meta, StoryObj } from "@storybook/react";
import { userEvent, within } from "@storybook/testing-library";
import { userEvent, within } from "@storybook/test";

import { Card } from "@/components/flashcard/Card";

const meta: Meta<typeof Card> = {
title: "Components/Card",
component: Card,
tags: ["autodocs"],
args: {
card: {
cardID: "C-12345678",
Expand Down Expand Up @@ -39,17 +38,7 @@ export const Delete: Story = {
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const deleteButton = await canvas.getByTestId("deleteCardButtonId");
const deleteButton = canvas.getByTestId("deleteCardButtonId");
await userEvent.click(deleteButton);
},
};

export const Placeholder: Story = {
args: {
card: {
cardID: "",
sides: [],
deckID: "D-1234567",
},
},
};
1 change: 0 additions & 1 deletion frontend/components/flashcard/Flashcard.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Flashcard } from "@/components/flashcard/Flashcard";
const meta: Meta<typeof Flashcard> = {
title: "Components/Flashcard",
component: Flashcard,
tags: ["autodocs"],
args: {
card: {
cardID: "C-12345678",
Expand Down
5 changes: 2 additions & 3 deletions frontend/components/form/InputField.stories.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { Meta, StoryObj } from "@storybook/react";
import { userEvent, within } from "@storybook/testing-library";
import { userEvent, within } from "@storybook/test";

import { InputField } from "@/components/form/InputField";

const meta: Meta<typeof InputField> = {
title: "Form/InputField",
component: InputField,
tags: ["autodocs"],
args: {
id: "InputFieldId",
},
Expand Down Expand Up @@ -99,7 +98,7 @@ export const PasswordShown: Story = {
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const icon = await canvas.getByTestId("inputFieldIconId");
const icon = canvas.getByTestId("inputFieldIconId");
await userEvent.click(icon);
},
};
Expand Down
1 change: 0 additions & 1 deletion frontend/components/form/TextArea.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { TextArea } from "@/components/form/TextArea";
const meta: Meta<typeof TextArea> = {
title: "Form/TextArea",
component: TextArea,
tags: ["autodocs"],
args: {
id: "TextAreaId",
},
Expand Down
1 change: 0 additions & 1 deletion frontend/components/graphics/Badge.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Badge } from "@/components/graphics/Badge";
const meta: Meta<typeof Badge> = {
title: "Components/Badge",
component: Badge,
tags: ["autodocs"],
args: {},
};

Expand Down
1 change: 0 additions & 1 deletion frontend/components/graphics/IconLabel.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { IconLabel } from "@/components/graphics/IconLabel";
const meta: Meta<typeof IconLabel> = {
title: "Graphics/IconLabel",
component: IconLabel,
tags: ["autodocs"],
args: {},
};

Expand Down
1 change: 0 additions & 1 deletion frontend/components/graphics/LoadingSpinner.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import LoadingSpinner from "@/components/graphics/LoadingSpinner";
const meta: Meta<typeof LoadingSpinner> = {
title: "Graphics/LoadingSpinner",
component: LoadingSpinner,
tags: ["autodocs"],
args: {
className: "w-16",
},
Expand Down
5 changes: 3 additions & 2 deletions frontend/components/graphics/Logo.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { Logo } from "@/components/graphics/Logo";
const meta: Meta<typeof Logo> = {
title: "Graphics/Logo",
component: Logo,
tags: ["autodocs"],
args: {},
args: {
href: "/",
},
};

export default meta;
Expand Down
5 changes: 2 additions & 3 deletions frontend/components/group/Member.stories.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { Meta, StoryObj } from "@storybook/react";
import { userEvent, within } from "@storybook/testing-library";
import { userEvent, within } from "@storybook/test";

import Member from "@/components/group/Member";

const meta: Meta<typeof Member> = {
title: "Components/Member",
component: Member,
tags: ["autodocs"],
args: {},
};

Expand Down Expand Up @@ -57,7 +56,7 @@ export const Delete: Story = {
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const deleteButton = await canvas.getByTestId("deleteUserButtonId");
const deleteButton = canvas.getByTestId("deleteUserButtonId");
await userEvent.click(deleteButton);
},
};
Expand Down
1 change: 0 additions & 1 deletion frontend/components/input/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Button } from "@/components/input/Button";
const meta: Meta<typeof Button> = {
title: "Input/Button",
component: Button,
tags: ["autodocs"],
args: {
id: "ButtonId",
},
Expand Down
1 change: 0 additions & 1 deletion frontend/components/input/DangerAction.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { DangerAction } from "@/components/input/DangerAction";
const meta: Meta<typeof DangerAction> = {
title: "Input/DangerAction",
component: DangerAction,
tags: ["autodocs"],
args: {
id: "dangerActionId",
},
Expand Down
1 change: 0 additions & 1 deletion frontend/components/input/InputAction.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { InputAction } from "@/components/input/InputAction";
const meta: Meta<typeof InputAction> = {
title: "Input/InputAction",
component: InputAction,
tags: ["autodocs"],
args: {
id: "inputActionId",
},
Expand Down
1 change: 0 additions & 1 deletion frontend/components/input/SelectionField.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { SelectionField } from "@/components/input/SelectionField";
const meta: Meta<typeof SelectionField> = {
title: "Input/SelectionField",
component: SelectionField,
tags: ["autodocs"],
args: {},
};

Expand Down
1 change: 0 additions & 1 deletion frontend/components/input/ToggleAction.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ToggleAction } from "@/components/input/ToggleAction";
const meta: Meta<typeof ToggleAction> = {
title: "Input/ToggleAction",
component: ToggleAction,
tags: ["autodocs"],
args: {
id: "toggleActionId",
choices: ["ONE", "TWO", "THREE"],
Expand Down
1 change: 0 additions & 1 deletion frontend/components/input/ToggleButtonGroup.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ToggleButtonGroup } from "@/components/input/ToggleButtonGroup";
const meta: Meta<typeof ToggleButtonGroup> = {
title: "Input/ToggleButtonGroup",
component: ToggleButtonGroup,
tags: ["autodocs"],
args: {
id: "ButtonId",
choices: ["ONE", "TWO", "THREE"],
Expand Down
1 change: 0 additions & 1 deletion frontend/components/layout/Header.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Header } from "@/components/layout/Header";
const meta: Meta<typeof Header> = {
title: "Layout/Header",
component: Header,
tags: ["autodocs"],
args: {},
};

Expand Down
1 change: 0 additions & 1 deletion frontend/components/layout/Section.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Section } from "@/components/layout/Section";
const meta: Meta<typeof Section> = {
title: "Layout/Section",
component: Section,
tags: ["autodocs"],
args: {
id: "sectionId",
},
Expand Down
1 change: 0 additions & 1 deletion frontend/components/navigation/Navbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Navbar } from "@/components/navigation/Navbar";
const meta: Meta<typeof Navbar> = {
title: "Navigation/NavBar",
component: Navbar,
tags: ["autodocs"],
args: {},
};

Expand Down
1 change: 0 additions & 1 deletion frontend/components/navigation/Tabs/TabHeader.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { TabHeader } from "@/components/navigation/Tabs/TabHeader";
const meta: Meta<typeof TabHeader> = {
title: "Navigation/Tabs/TabHeader",
component: TabHeader,
tags: ["autodocs"],
args: {
id: "TabHeaderId",
},
Expand Down
1 change: 0 additions & 1 deletion frontend/components/statistics/Statistic.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Statistic } from "@/components/statistics/Statistic";
const meta: Meta<typeof Statistic> = {
title: "Statistics/Statistic",
component: Statistic,
tags: ["autodocs"],
args: {
id: "StatisticId",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { StatisticOverview } from "@/components/statistics/StatisticOverview";
const meta: Meta<typeof StatisticOverview> = {
title: "Statistics/StatisticOverview",
component: StatisticOverview,
tags: ["autodocs"],
args: {
id: "StatisticId",
},
Expand Down
Loading

0 comments on commit b468c61

Please sign in to comment.