Skip to content

Commit aaabdc6

Browse files
feat: update storybook (#114)
1 parent c5d95b8 commit aaabdc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1752
-1939
lines changed

.storybook/main.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@ import type { StorybookConfig } from "@storybook/react-vite";
22

33
const config: StorybookConfig = {
44
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5-
addons: [
6-
"@storybook/addon-links",
7-
"@storybook/addon-essentials",
8-
"@storybook/addon-onboarding",
9-
"@storybook/addon-interactions",
10-
"@storybook/addon-themes"
11-
],
5+
addons: ["@storybook/addon-docs", "@storybook/addon-onboarding", "@storybook/addon-themes"],
6+
127
framework: {
138
name: "@storybook/react-vite",
149
options: {}
15-
},
16-
docs: {
17-
autodocs: "tag"
1810
}
1911
};
2012
export default config;

.storybook/preview.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Preview, ReactRenderer } from "@storybook/react";
1+
import type { Preview, ReactRenderer } from "@storybook/react-vite";
22
import { withThemeByClassName } from "@storybook/addon-themes";
33

44
/* TODO: update import to your tailwind styles file. If you're using Angular, inject this through your angular.json config instead */
@@ -7,11 +7,10 @@ import "../src/index.css";
77
const preview: Preview = {
88
parameters: {
99
backgrounds: {
10-
default: "light",
11-
values: [
12-
{ name: "light", value: "#F9FAFB" },
13-
{ name: "dark", value: "#1F2937" }
14-
]
10+
options: {
11+
light: { name: "Light", value: "#F9FAFB" },
12+
dark: { name: "Dark", value: "#1F2937" }
13+
}
1514
},
1615
actions: { argTypesRegex: "^on[A-Z].*" },
1716
controls: {
@@ -21,6 +20,9 @@ const preview: Preview = {
2120
}
2221
}
2322
},
23+
initialGlobals: {
24+
backgrounds: { value: "light" }
25+
},
2426

2527
decorators: [
2628
// Adds theme switching support.

eslint.config.mjs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
1+
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2+
import storybook from "eslint-plugin-storybook";
3+
14
import js from "@eslint/js";
25
import globals from "globals";
36
import reactHooks from "eslint-plugin-react-hooks";
47
import reactRefresh from "eslint-plugin-react-refresh";
58
import tseslint from "typescript-eslint";
6-
import storybook from "eslint-plugin-storybook";
9+
import { defineConfig, globalIgnores } from "eslint/config";
710

8-
export default tseslint.config(
9-
{ ignores: ["dist"] },
11+
export default defineConfig([
12+
globalIgnores(["dist"]),
1013
{
11-
extends: [js.configs.recommended, ...tseslint.configs.recommended],
14+
plugins: {
15+
storybook
16+
},
1217
files: ["**/*.{ts,tsx}"],
18+
extends: [
19+
js.configs.recommended,
20+
tseslint.configs.recommended,
21+
reactHooks.configs.flat.recommended,
22+
reactRefresh.configs.vite
23+
],
1324
languageOptions: {
1425
ecmaVersion: 2020,
1526
globals: globals.browser
1627
},
17-
plugins: {
18-
"react-hooks": reactHooks,
19-
"react-refresh": reactRefresh,
20-
storybook
21-
},
2228
rules: {
2329
...reactHooks.configs.recommended.rules,
2430
"react/prop-types": "off",
2531
"react-refresh/only-export-components": ["off", { allowConstantExport: true }]
2632
}
2733
}
28-
);
34+
]);

package.json

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,34 +77,30 @@
7777
"tailwind-merge": "^2.6.0"
7878
},
7979
"devDependencies": {
80-
"@changesets/cli": "^2.28.1",
81-
"@eslint/js": "^9.21.0",
82-
"@storybook/addon-essentials": "^8.5.8",
83-
"@storybook/addon-interactions": "^8.5.8",
84-
"@storybook/addon-links": "^8.5.8",
85-
"@storybook/addon-onboarding": "^8.5.8",
86-
"@storybook/addon-themes": "^8.5.8",
87-
"@storybook/blocks": "^8.5.8",
88-
"@storybook/react": "^8.5.8",
89-
"@storybook/react-vite": "^8.5.8",
90-
"@storybook/testing-library": "^0.2.2",
80+
"@changesets/cli": "^2.29.7",
81+
"@eslint/js": "^9.39.1",
82+
"@storybook/addon-docs": "10.0.7",
83+
"@storybook/addon-onboarding": "^10.0.7",
84+
"@storybook/addon-themes": "^10.0.7",
85+
"@storybook/react-vite": "^10.0.7",
9186
"autoprefixer": "^10.4.20",
92-
"eslint": "^9.21.0",
93-
"eslint-plugin-react-hooks": "^5.1.0",
94-
"eslint-plugin-react-refresh": "^0.4.19",
95-
"eslint-plugin-storybook": "^0.11.2",
96-
"globals": "^15.14.0",
87+
"eslint": "^9.39.1",
88+
"eslint-plugin-react-hooks": "^7.0.1",
89+
"eslint-plugin-react-refresh": "^0.4.24",
90+
"eslint-plugin-storybook": "^10.0.7",
91+
"globals": "^16.5.0",
9792
"husky": "^9.1.7",
9893
"lint-staged": "^15.4.3",
9994
"postcss": "^8.5.3",
10095
"prettier": "^3.5.2",
101-
"publint": "^0.3.4",
102-
"storybook": "^8.5.8",
96+
"publint": "^0.3.15",
97+
"storybook": "^10.0.7",
10398
"tailwindcss": "^3.4.17",
10499
"tailwindcss-animate": "^1.0.7",
105-
"tsup": "^8.3.6",
100+
"tsup": "^8.5.1",
106101
"typescript": "^5.7.3",
107-
"typescript-eslint": "^8.24.1",
102+
"typescript-eslint": "^8.46.4",
103+
"vite": "^7.2.2",
108104
"vitest": "^3.0.6"
109105
},
110106
"peerDependencies": {

0 commit comments

Comments
 (0)