Skip to content

Commit 470bcf2

Browse files
committed
storybook upgraded and working
1 parent 8535733 commit 470bcf2

Some content is hidden

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

51 files changed

+935
-538
lines changed

.eslintrc.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,7 @@ module.exports = {
1515
version: 'detect',
1616
},
1717
},
18-
extends: [
19-
'plugin:react/recommended',
20-
'plugin:@typescript-eslint/recommended',
21-
'prettier',
22-
'plugin:import/errors',
23-
'plugin:import/warnings',
24-
'plugin:import/typescript',
25-
'plugin:jsx-a11y/recommended',
26-
'plugin:react-hooks/recommended',
27-
],
18+
extends: ['plugin:react/recommended', 'plugin:@typescript-eslint/recommended', 'prettier', 'plugin:import/errors', 'plugin:import/warnings', 'plugin:import/typescript', 'plugin:jsx-a11y/recommended', 'plugin:react-hooks/recommended', 'plugin:storybook/recommended'],
2819
rules: {
2920
'react/prop-types': 0,
3021
'jsx-a11y/anchor-has-content': 0,

.storybook/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import tsConfigPaths from 'vite-tsconfig-paths';
44

55
const config: StorybookConfig = {
66
stories: ['../stories/**/*.stories.@(ts|tsx)', '../stories/**/*.mdx'],
7-
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
7+
addons: ['@storybook/addon-links', '@storybook/addon-docs'],
8+
89
framework: {
910
name: '@storybook/react-vite',
1011
options: {},
1112
},
12-
docs: {
13-
autodocs: true,
14-
},
13+
1514
typescript: {
1615
reactDocgen: 'react-docgen-typescript',
1716
},
17+
1818
viteFinal(config) {
1919
return mergeConfig(config, {
2020
plugins: [tsConfigPaths()],
2121
});
22-
},
22+
}
2323
};
2424
export default config;

.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addons } from '@storybook/manager-api';
1+
import { addons } from 'storybook/manager-api';
22
import nhsTheme from './theme';
33
import { startCase, upperFirst } from "lodash";
44

.storybook/preview.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import './storybook.scss';
2-
import { Preview } from '@storybook/react';
2+
import { Preview } from '@storybook/react-vite';
33

44
const preview: Preview = {
55
parameters: {
@@ -18,5 +18,7 @@ const preview: Preview = {
1818
},
1919
},
2020
},
21+
22+
tags: ['autodocs']
2123
};
2224
export default preview;

.storybook/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { create } from '@storybook/theming/create';
1+
import { create } from 'storybook/theming/create';
22
const version = require('../package.json').version;
33

44
export default create({

package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
"@rollup/plugin-node-resolve": "^15.2.3",
4040
"@rollup/plugin-terser": "^0.4.4",
4141
"@rollup/plugin-typescript": "^11.1.6",
42-
"@storybook/addon-essentials": "^8.0.5",
43-
"@storybook/react": "^8.0.5",
44-
"@storybook/react-vite": "^8.0.5",
45-
"@storybook/theming": "^8.0.5",
42+
"@storybook/addon-docs": "9.1.3",
43+
"@storybook/react-vite": "^9.1.3",
4644
"@testing-library/react": "^16.3.0",
45+
"@types/lodash": "^4",
4746
"@types/react": "^18.2.60",
4847
"@types/react-dom": "^18.2.19",
48+
"eslint-plugin-storybook": "9.1.3",
4949
"nhsuk-frontend": "^9.0.1",
5050
"react": "^19.1.1",
5151
"react-dom": "^19.1.1",
@@ -55,11 +55,16 @@
5555
"rollup-plugin-preserve-directives": "^0.4.0",
5656
"rollup-plugin-tsconfig-paths": "^1.5.2",
5757
"sass": "^1.53.0",
58+
"storybook": "^9.1.3",
5859
"tslib": "^2.8.1",
5960
"typescript": "5.3.3",
60-
"vite": "^4.5.3",
61+
"vite": "^7.1.3",
6162
"vite-tsconfig-paths": "^4.3.2"
6263
},
6364
"license": "MIT",
64-
"packageManager": "[email protected]"
65+
"packageManager": "[email protected]",
66+
"dependencies": {
67+
"classnames": "^2.5.1",
68+
"lodash": "^4.17.21"
69+
}
6570
}

stories/Content Presentation/Details.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { Details } from '../../src';
3-
import { Meta, StoryObj } from '@storybook/react';
3+
import { Meta, StoryObj } from '@storybook/react-vite';
44

55
/**
66
* This component can be found in the `nhsuk-frontend` repository <a href="https://github.com/nhsuk/nhsuk-frontend/tree/master/packages/components/contents-list" target="_blank">here</a>.

stories/Content Presentation/DoAndDontList.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { DoAndDontList } from '../../src';
3-
import { Meta, StoryObj } from '@storybook/react';
3+
import { Meta, StoryObj } from '@storybook/react-vite';
44

55
/**
66
* This component can be found in the `nhsuk-frontend` repository <a href="https://github.com/nhsuk/nhsuk-frontend/tree/master/packages/components/do-dont-list" target="_blank" rel="noopener noreferrer">here</a>.

stories/Content Presentation/Hero.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { Hero } from '../../src';
3-
import { Meta, StoryObj } from '@storybook/react';
3+
import { Meta, StoryObj } from '@storybook/react-vite';
44

55
const meta: Meta<typeof Hero> = {
66
title: 'Content Presentation/Hero',

stories/Content Presentation/Icons.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
SearchIcon,
1515
TickIcon,
1616
} from '../../src';
17-
import { Meta, StoryObj } from '@storybook/react';
17+
import { Meta, StoryObj } from '@storybook/react-vite';
1818

1919
const meta: Meta = {
2020
title: 'Content Presentation/Icons',

0 commit comments

Comments
 (0)