Skip to content

Commit 8efc8c5

Browse files
renovate[bot]aldbr
authored andcommitted
chore(deps): update dependency @chromatic-com/storybook to v5
1 parent f9cfacb commit 8efc8c5

19 files changed

Lines changed: 13282 additions & 20961 deletions

package-lock.json

Lines changed: 13224 additions & 20899 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/diracx-web-components/.storybook/main.ts

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,20 @@
1-
import { join, dirname } from "path";
1+
import { dirname, resolve } from "path";
2+
import { fileURLToPath } from "url";
23
import type { StorybookConfig } from "@storybook/nextjs";
34

4-
/**
5-
* This function is used to resolve the absolute path of a package.
6-
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
7-
*/
8-
function getAbsolutePath(value: string): string {
9-
return dirname(require.resolve(join(value, "package.json")));
10-
}
5+
const __dirname = dirname(fileURLToPath(import.meta.url));
6+
117
const config: StorybookConfig = {
12-
stories: [
13-
"./*.mdx",
14-
"../**/*.mdx",
15-
"../stories/*.stories.@(js|jsx|mjs|ts|tsx)",
16-
],
8+
stories: ["../stories/*.mdx", "../stories/*.stories.@(js|jsx|mjs|ts|tsx)"],
179

1810
addons: [
19-
getAbsolutePath("@storybook/addon-links"),
20-
getAbsolutePath("@storybook/addon-essentials"),
21-
getAbsolutePath("@chromatic-com/storybook"),
22-
getAbsolutePath("@storybook/addon-interactions"),
23-
getAbsolutePath("@storybook/addon-mdx-gfm"),
11+
"@storybook/addon-docs",
12+
"@storybook/addon-links",
13+
"@chromatic-com/storybook",
2414
],
2515

2616
framework: {
27-
name: getAbsolutePath("@storybook/nextjs"),
17+
name: "@storybook/nextjs",
2818
options: {},
2919
},
3020

@@ -34,15 +24,23 @@ const config: StorybookConfig = {
3424
if (!config.resolve) {
3525
return config;
3626
}
27+
// Handle .md files as raw text for MDX imports
28+
config.module?.rules?.push({
29+
test: /\.md$/,
30+
type: "asset/source",
31+
});
3732
config.resolve.alias = {
3833
...config.resolve.alias,
39-
"@axa-fr/react-oidc": require.resolve(
34+
"@axa-fr/react-oidc": resolve(
35+
__dirname,
4036
"../stories/mocks/react-oidc.mock.tsx",
4137
),
42-
"../../hooks/metadata": require.resolve(
38+
"../../hooks/metadata": resolve(
39+
__dirname,
4340
"../stories/mocks/metadata.mock.tsx",
4441
),
45-
"./jobDataService": require.resolve(
42+
"./jobDataService": resolve(
43+
__dirname,
4644
"../stories/mocks/jobDataService.mock.tsx",
4745
),
4846
};

packages/diracx-web-components/.storybook/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Preview } from "@storybook/react";
1+
import type { Preview } from "@storybook/nextjs";
22
import { CssBaseline } from "@mui/material";
33
import { ThemeProvider } from "../src/contexts/ThemeProvider";
44

packages/diracx-web-components/eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
44
import _import from "eslint-plugin-import";
55
import typescriptEslint from "@typescript-eslint/eslint-plugin";
66
import react from "eslint-plugin-react";
7+
import reactHooks from "eslint-plugin-react-hooks";
78
import tsParser from "@typescript-eslint/parser";
89
import js from "@eslint/js";
910
import { FlatCompat } from "@eslint/eslintrc";
@@ -20,12 +21,12 @@ const compat = new FlatCompat({
2021
export default [
2122
...fixupConfigRules(
2223
compat.extends(
23-
"next/core-web-vitals",
2424
"plugin:import/recommended",
2525
"plugin:import/typescript",
2626
"plugin:storybook/recommended",
2727
"plugin:@typescript-eslint/recommended",
2828
"plugin:react/recommended",
29+
"plugin:react-hooks/recommended",
2930
"prettier",
3031
),
3132
),
@@ -62,7 +63,6 @@ export default [
6263

6364
rules: {
6465
"@typescript-eslint/no-deprecated": "warn",
65-
"@next/next/no-html-link-for-pages": "off", // We don't have pages, it's a library
6666
"import/order": ["error"],
6767
"import/no-unused-modules": ["error"],
6868
"import/no-useless-path-segments": ["error"],

packages/diracx-web-components/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const config = {
1919

2020
// To support ESM modules in Jest
2121
transformIgnorePatterns: [
22-
"/node_modules/(?!d3|d3-[^/]+|internmap|delaunator|robust-predicates)",
22+
"/node_modules/(?!d3|d3-[^/]+|internmap|delaunator|robust-predicates|storybook|@storybook)",
2323
],
2424

2525
// Tell Jest how to transform files

packages/diracx-web-components/package.json

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@atlaskit/pragmatic-drag-and-drop": "^1.3.0",
2424
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
2525
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.0.0",
26-
"@axa-fr/react-oidc": "^7.24.0",
26+
"@axa-fr/react-oidc": ">=7.24.0 <7.26.0",
2727
"@emotion/react": "^11.11.4",
2828
"@emotion/styled": "^11.11.5",
2929
"@mui/icons-material": "^7.0.0",
@@ -48,19 +48,15 @@
4848
"@babel/preset-env": "^7.28.0",
4949
"@babel/preset-react": "^7.24.7",
5050
"@babel/preset-typescript": "^7.24.7",
51-
"@chromatic-com/storybook": "^3.2.4",
51+
"@chromatic-com/storybook": "^5.0.0",
5252
"@eslint/compat": "^2.0.0",
5353
"@eslint/eslintrc": "^3.1.0",
5454
"@eslint/js": "^9.14.0",
5555
"@microsoft/api-extractor": "^7.43.7",
56-
"@storybook/addon-essentials": "^8.6.11",
57-
"@storybook/addon-interactions": "^8.6.11",
58-
"@storybook/addon-links": "^8.5.3",
59-
"@storybook/addon-mdx-gfm": "^8.5.3",
60-
"@storybook/blocks": "^8.5.3",
61-
"@storybook/nextjs": "^8.5.3",
62-
"@storybook/react": "^8.5.3",
63-
"@storybook/test": "^8.5.3",
56+
"@storybook/addon-docs": "^10.2.10",
57+
"@storybook/addon-links": "^10.2.10",
58+
"@storybook/nextjs": "^10.2.10",
59+
"@storybook/react": "^10.2.10",
6460
"@testing-library/jest-dom": "^6.1.4",
6561
"@testing-library/react": "^16.3.0",
6662
"@testing-library/user-event": "^14.5.1",
@@ -73,14 +69,15 @@
7369
"eslint-config-prettier": "^10.0.1",
7470
"eslint-plugin-import": "^2.29.1",
7571
"eslint-plugin-react": "^7.37.1",
76-
"eslint-plugin-storybook": "^0.12.0",
72+
"eslint-plugin-react-hooks": "^5.0.0",
73+
"eslint-plugin-storybook": "^10.2.10",
7774
"install": "^0.13.0",
7875
"jest": "^30.0.0",
7976
"jest-environment-jsdom": "^30.0.0",
8077
"lint-staged": "^16.0.0",
8178
"prettier": "^3.2.5",
8279
"react-test-renderer": "^18.3.1",
83-
"storybook": "^8.6.12",
80+
"storybook": "^10.2.10",
8481
"ts-jest": "^29.1.2",
8582
"tsup": "^8.0.2",
8683
"typescript": "^5.6.3"

packages/diracx-web-components/src/components/shared/SearchBar/DatePicker.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import React, { KeyboardEvent, useState } from "react";
99
import "dayjs/locale/en-gb"; // Import the locale for dayjs
1010
import { TextField, TextFieldProps } from "@mui/material";
1111

12-
interface CustomDateTimePickerProps
13-
extends Omit<DateTimePickerProps, "value" | "onChange"> {
12+
interface CustomDateTimePickerProps extends Omit<
13+
DateTimePickerProps,
14+
"value" | "onChange"
15+
> {
1416
value: string | null;
1517
onDateAccepted: (value: string | null) => void;
1618
handleArrowKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;

packages/diracx-web-components/stories/ChartView.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, StoryObj } from "@storybook/react";
1+
import type { Meta, StoryObj } from "@storybook/nextjs";
22

33
import { useState } from "react";
44
import { ChartView } from "../src/components/shared";
@@ -84,7 +84,7 @@ export const Default: Story = {
8484
control: { disable: true },
8585
},
8686
},
87-
render: (args) => {
87+
render: function ChartViewRender(args) {
8888
const [groupColumns, setGroupColumns] = useState(args.groupColumns);
8989
const [currentPath, setCurrentPath] = useState(args.currentPath);
9090

packages/diracx-web-components/stories/Dashboard.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from "react";
2-
import type { Meta, StoryObj } from "@storybook/react";
2+
import type { Meta, StoryObj } from "@storybook/nextjs";
33
import { Box } from "@mui/material";
44
import { ApplicationsContext } from "../src/contexts/ApplicationsProvider";
55
import { NavigationProvider } from "../src/contexts/NavigationProvider";

packages/diracx-web-components/stories/DataTable.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, StoryObj } from "@storybook/react";
1+
import { Meta, StoryObj } from "@storybook/nextjs";
22
import {
33
createColumnHelper,
44
getCoreRowModel,
@@ -78,7 +78,7 @@ export const Default: Story = {
7878
toolbarComponents: <></>,
7979
menuItems: [{ label: "Edit", onClick: () => {} }],
8080
},
81-
render: (args) => {
81+
render: function DataTableRender(args) {
8282
const table = useReactTable<SimpleItem>({
8383
data,
8484
columns: columnDefs,

0 commit comments

Comments
 (0)