Skip to content

chore: upgrade to storybook 9 #18983

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

Open
wants to merge 8 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 1 addition & 9 deletions site/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@ module.exports = {

addons: [
"@chromatic-com/storybook",
{
name: "@storybook/addon-essentials",
options: {
backgrounds: false,
},
},
"@storybook/addon-docs",
"@storybook/addon-links",
"@storybook/addon-mdx-gfm",
"@storybook/addon-themes",
"@storybook/addon-actions",
"@storybook/addon-interactions",
"storybook-addon-remix-react-router",
],

Expand Down
4 changes: 2 additions & 2 deletions site/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* @typedef {import("react").PropsWithChildren} PropsWithChildren
* @typedef {import("react").FC<PropsWithChildren>} FC
*
* @typedef {import("@storybook/react").StoryContext} StoryContext
* @typedef {import("@storybook/react").Preview} Preview
* @typedef {import("@storybook/react-vite").StoryContext} StoryContext
* @typedef {import("@storybook/react-vite").Preview} Preview
*
* @typedef {(Story: FC, Context: StoryContext) => React.JSX.Element} Decorator A
* Storybook decorator function used to inject baseline data dependencies into
Expand Down
24 changes: 9 additions & 15 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"react-markdown": "9.0.3",
"react-query": "npm:@tanstack/react-query@5.77.0",
"react-resizable-panels": "3.0.3",
"react-router-dom": "6.26.2",
"react-router": "7.7.0",
"react-syntax-highlighter": "15.6.1",
"react-textarea-autosize": "8.5.9",
"react-virtualized-auto-sizer": "1.0.24",
Expand All @@ -125,19 +125,13 @@
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@chromatic-com/storybook": "3.2.2",
"@chromatic-com/storybook": "4.0.1",
"@octokit/types": "12.3.0",
"@playwright/test": "1.47.0",
"@storybook/addon-actions": "8.5.2",
"@storybook/addon-essentials": "8.4.6",
"@storybook/addon-interactions": "8.5.3",
"@storybook/addon-links": "8.5.2",
"@storybook/addon-mdx-gfm": "8.5.2",
"@storybook/addon-themes": "8.4.6",
"@storybook/preview-api": "8.5.3",
"@storybook/react": "8.4.6",
"@storybook/react-vite": "8.4.6",
"@storybook/test": "8.4.6",
"@storybook/addon-docs": "9.0.17",
"@storybook/addon-links": "9.0.17",
"@storybook/addon-themes": "9.0.17",
"@storybook/react-vite": "9.0.17",
"@swc/core": "1.3.38",
"@swc/jest": "0.2.37",
"@tailwindcss/typography": "0.5.16",
Expand Down Expand Up @@ -182,8 +176,8 @@
"rollup-plugin-visualizer": "5.14.0",
"rxjs": "7.8.1",
"ssh2": "1.16.0",
"storybook": "8.5.3",
"storybook-addon-remix-react-router": "3.1.0",
"storybook": "9.0.17",
"storybook-addon-remix-react-router": "5.0.0",
"tailwindcss": "3.4.17",
"ts-proto": "1.164.0",
"typescript": "5.6.3",
Expand All @@ -197,7 +191,7 @@
"semver": "7.6.2"
},
"engines": {
"npm": ">=9.0.0 <10.0.0",
"pnpm": ">=9.0.0 <10.0.0",
"node": ">=18.0.0 <21.0.0"
},
"pnpm": {
Expand Down
1,050 changes: 290 additions & 760 deletions site/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion site/src/@types/storybook.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
import type { Permissions } from "modules/permissions";
import type { QueryKey } from "react-query";

declare module "@storybook/react" {
declare module "@storybook/react-vite" {
type WebSocketEvent =
| { event: "message"; data: string }
| { event: "error" | "close" };
Expand Down
2 changes: 1 addition & 1 deletion site/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "react";
import { HelmetProvider } from "react-helmet-async";
import { QueryClient, QueryClientProvider } from "react-query";
import { RouterProvider } from "react-router-dom";
import { RouterProvider } from "react-router";
import { GlobalSnackbar } from "./components/GlobalSnackbar/GlobalSnackbar";
import { ThemeProvider } from "./contexts/ThemeProvider";
import { AuthProvider } from "./contexts/auth/AuthProvider";
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Abbr/Abbr.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Abbr } from "./Abbr";

const meta: Meta<typeof Abbr> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { ActiveUserChart } from "./ActiveUserChart";

const meta: Meta<typeof ActiveUserChart> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Alert/Alert.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "components/Button/Button";
import { Alert } from "./Alert";

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Alert/ErrorAlert.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "components/Button/Button";
import { mockApiError } from "testHelpers/entities";
import { ErrorAlert } from "./ErrorAlert";
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Avatar/Avatar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Avatar } from "./Avatar";

const meta: Meta<typeof Avatar> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Avatar/AvatarCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { AvatarCard } from "./AvatarCard";

const meta: Meta<typeof AvatarCard> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Avatar/AvatarData.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { AvatarData } from "./AvatarData";

const meta: Meta<typeof AvatarData> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Avatar/AvatarDataSkeleton.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { AvatarDataSkeleton } from "./AvatarDataSkeleton";

const meta: Meta<typeof AvatarDataSkeleton> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Badge/Badge.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Settings, TriangleAlert } from "lucide-react";
import { Badge } from "./Badge";

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Badges/Badges.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import {
AlphaBadge,
Badges,
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Breadcrumb/Breadcrumb.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import {
Breadcrumb,
BreadcrumbEllipsis,
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/BuildIcon/BuildIcon.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { BuildIcon } from "./BuildIcon";

const meta: Meta<typeof BuildIcon> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { PlusIcon } from "lucide-react";
import { Button } from "./Button";

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Chart/Chart.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from "recharts";
import {
type ChartConfig,
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Checkbox/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import React from "react";
import { Checkbox } from "./Checkbox";

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/CodeExample/CodeExample.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { CodeExample } from "./CodeExample";

const meta: Meta<typeof CodeExample> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Collapsible/Collapsible.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "components/Button/Button";
import { ChevronsUpDown } from "lucide-react";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "../Button/Button";
import { CollapsibleSummary } from "./CollapsibleSummary";

Expand Down
8 changes: 5 additions & 3 deletions site/src/components/Combobox/Combobox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";
import { expect, screen, userEvent, waitFor, within } from "@storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { useState } from "react";
import { expect, screen, userEvent, waitFor, within } from "storybook/test";
import { Combobox } from "./Combobox";

const simpleOptions = ["Go", "Gleam", "Kotlin", "Rust"];
Expand Down Expand Up @@ -31,7 +31,9 @@ const advancedOptions = [

const ComboboxWithHooks = ({
options = advancedOptions,
}: { options?: React.ComponentProps<typeof Combobox>["options"] }) => {
}: {
options?: React.ComponentProps<typeof Combobox>["options"];
}) => {
const [value, setValue] = useState("");
const [open, setOpen] = useState(false);
const [inputValue, setInputValue] = useState("");
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Conditionals/ChooseOne.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { ChooseOne, Cond } from "./ChooseOne";

const meta: Meta<typeof ChooseOne> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/CopyButton/CopyButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { CopyButton } from "./CopyButton";

const meta: Meta<typeof CopyButton> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { CopyableValue } from "./CopyableValue";

const meta: Meta<typeof CopyableValue> = {
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Dialog/Dialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";
import { userEvent, within } from "@storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "components/Button/Button";
import { userEvent, within } from "storybook/test";
import {
Dialog,
DialogContent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { action } from "@storybook/addon-actions";
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { action } from "storybook/actions";
import { ConfirmDialog } from "./ConfirmDialog";

const meta: Meta<typeof ConfirmDialog> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { action } from "@storybook/addon-actions";
import type { Meta, StoryObj } from "@storybook/react";
import { userEvent } from "@storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { within } from "@testing-library/react";
import { action } from "storybook/actions";
import { userEvent } from "storybook/test";
import { DeleteDialog } from "./DeleteDialog";

const meta: Meta<typeof DeleteDialog> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { chromatic } from "testHelpers/chromatic";
import { DropdownArrow } from "./DropdownArrow";

Expand Down
4 changes: 2 additions & 2 deletions site/src/components/DropdownMenu/DropdownMenu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";
import { userEvent, within } from "@storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "components/Button/Button";
import { userEvent, within } from "storybook/test";
import {
DropdownMenu,
DropdownMenuContent,
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/DurationField/DurationField.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";
import { expect, userEvent, within } from "@storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { useState } from "react";
import { expect, userEvent, within } from "storybook/test";
import { DurationField } from "./DurationField";

const meta: Meta<typeof DurationField> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/EmptyState/EmptyState.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "components/Button/Button";
import { EmptyState } from "./EmptyState";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from "@storybook/react";
import { expect, userEvent } from "@storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { within } from "@testing-library/react";
import type { ErrorResponse } from "react-router-dom";
import type { ErrorResponse } from "react-router";
import { expect, userEvent } from "storybook/test";
import { GlobalErrorBoundaryInner } from "./GlobalErrorBoundary";

/**
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/ErrorBoundary/GlobalErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
isRouteErrorResponse,
useLocation,
useRouteError,
} from "react-router-dom";
} from "react-router";

const errorPageTitle = "Something went wrong";

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Expander/Expander.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Expander } from "./Expander";

const meta: Meta<typeof Expander> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { FeatureStageBadge } from "./FeatureStageBadge";

const meta: Meta<typeof FeatureStageBadge> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/FileUpload/FileUpload.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from "@mui/material/Link";
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { FileUpload } from "./FileUpload";

const meta: Meta<typeof FileUpload> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Filter/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useDebouncedFunction } from "hooks/debounce";
import { ExternalLinkIcon } from "lucide-react";
import { ChevronDownIcon } from "lucide-react";
import { type FC, type ReactNode, useEffect, useRef, useState } from "react";
import type { useSearchParams } from "react-router-dom";
import type { useSearchParams } from "react-router";

type PresetFilter = {
name: string;
Expand Down
6 changes: 3 additions & 3 deletions site/src/components/Filter/SelectFilter.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { action } from "@storybook/addon-actions";
import type { Meta, StoryObj } from "@storybook/react";
import { expect, userEvent, within } from "@storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Avatar } from "components/Avatar/Avatar";
import { useState } from "react";
import { action } from "storybook/actions";
import { expect, userEvent, within } from "storybook/test";
import { withDesktopViewport } from "testHelpers/storybook";
import {
SelectFilter,
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Filter/storyHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { action } from "@storybook/addon-actions";
import { action } from "storybook/actions";
import type { UseFilterResult } from "./Filter";
import type { UseFilterMenuResult } from "./menu";

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Form/Form.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import TextField from "@mui/material/TextField";
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Form, FormFields, FormSection } from "./Form";

const meta: Meta<typeof Form> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/FullPageForm/FullPageForm.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import TextField from "@mui/material/TextField";
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "components/Button/Button";
import { FormFooter } from "components/Form/Form";
import type { FC } from "react";
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/FullPageLayout/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import type { ComponentProps, FC, HTMLAttributes } from "react";
import { Link, type LinkProps } from "react-router-dom";
import { Link, type LinkProps } from "react-router";
import { TopbarIconButton } from "./Topbar";

export const Sidebar: FC<HTMLAttributes<HTMLDivElement>> = (props) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { EnterpriseSnackbar } from "./EnterpriseSnackbar";

const meta: Meta<typeof EnterpriseSnackbar> = {
Expand Down
Loading