Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update frontend dependencies and migrate storybook from 7.6.15 to v8.1.10 #289

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading