Skip to content

Commit c694cbb

Browse files
Use ES modules for Storybook
1 parent 194b05a commit c694cbb

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

.storybook/manager.ts

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

55
const sentenceCase = (name = '') => {

stories/Content Presentation/NotificationBanner.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { type Meta, type StoryObj } from '@storybook/react-vite';
2-
import { NotificationBanner } from '#components';
3-
import { NotificationBannerLink } from '#components/content-presentation/notification-banner/components';
2+
import { NotificationBanner, NotificationBannerLink } from '#components';
43

54
/**
65
* This component can be found in the `nhsuk-frontend` repository <a href="https://github.com/nhsuk/nhsuk-frontend/tree/main/packages/nhsuk-frontend/src/nhsuk/components/notification-banner" target="_blank">here</a>.

tsconfig.dev.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
"types": ["jest", "node"]
88
},
99
"include": [
10-
"./.storybook/*.ts",
1110
"./src/**/*.test.ts",
1211
"./src/**/*.test.tsx",
1312
"./src/setupTests.ts",
14-
"./stories/**/*.tsx",
1513
"./*.config.cjs",
1614
"./*.config.js"
1715
]

tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
},
88
{
99
"path": "./tsconfig.build.json"
10+
},
11+
{
12+
"path": "./tsconfig.stories.json"
1013
}
1114
]
1215
}

tsconfig.stories.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"jsx": "react-jsxdev",
5+
"types": ["node"]
6+
},
7+
"include": ["./.storybook/*.ts", "./stories/**/*.tsx"]
8+
}

0 commit comments

Comments
 (0)