Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ const config: StorybookConfig = {
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
},
},
webpackFinal: async (config) => {
config.module = config.module || {};
config.module.rules = config.module.rules || [];

// Ensure TypeScript files are handled correctly
config.module.rules.push({
test: /\.tsx?$/,
use: [
{
loader: require.resolve('ts-loader'),
options: {
transpileOnly: true,
},
},
],
exclude: /node_modules/,
});

return config;
},
stories: ['../src/**/*.@(stories.tsx|mdx)'],
addons: [
{
Expand All @@ -19,8 +39,7 @@ const config: StorybookConfig = {
actions: false,
},
},
'@storybook/addon-storysource',
'@storybook/addon-styling',
'@storybook/addon-themes',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace deprecated dependency, as they do dot support React19.

'@storybook/addon-a11y',
],
framework: {
Expand Down
4 changes: 2 additions & 2 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { create } from '@storybook/theming';
import { addons } from '@storybook/addons';
import { addons } from '@storybook/manager-api';

addons.setConfig({
theme:create({
base: 'light',
brandTitle: 'Amazon Chime SDK Components'
})
});
});
55 changes: 29 additions & 26 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
import { ThemeProvider } from 'styled-components';
import { withThemeFromJSXProvider } from '@storybook/addon-styling';
import { withThemeFromJSXProvider } from '@storybook/addon-themes';
import type { Preview } from '@storybook/react';

import { GlobalStyles } from '../src/theme/GlobalStyles';
import lightTheme from '../src/theme/light';
import darkTheme from '../src/theme/dark';

export const decorators = [
withThemeFromJSXProvider({
themes: {
light: lightTheme,
dark: darkTheme,
},
defaultTheme: 'light',
Provider: ThemeProvider,
GlobalStyles: GlobalStyles,
}),
];

export const argTypes = {
tag: { table: { disable: true } },
id: { table: { disable: true } },
className: { table: { disable: true } },
css: { table: { disable: true } },
testId: { table: { disable: true } },
viewBox: { table: { disable: true } },
height: { table: { disable: true } },
title: { table: { disable: true } },
children: { table: { disable: true } },
const preview: Preview = {
decorators: [
withThemeFromJSXProvider({
themes: {
light: lightTheme,
dark: darkTheme,
},
defaultTheme: 'light',
Provider: ThemeProvider,
GlobalStyles: GlobalStyles,
}),
],
argTypes: {
tag: { table: { disable: true } },
id: { table: { disable: true } },
className: { table: { disable: true } },
css: { table: { disable: true } },
testId: { table: { disable: true } },
viewBox: { table: { disable: true } },
height: { table: { disable: true } },
title: { table: { disable: true } },
children: { table: { disable: true } },
},
parameters: {
layout: 'centered',
},
};

export const parameters = {
layout: 'centered',
};
export default preview;
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed

### Changed
- Add support for React 19.
- Migrate storybook to v8.
- Migrate Jest to v29.
- Rewrite PopOver component using floating-ui

### Fixed

Expand Down
11 changes: 5 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ module.exports = {
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'jsx', 'node'],
transform: {
'\\.tsx?$': 'ts-jest',
'^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx'
},
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json'
}
'^.+\\.m?js$': 'ts-jest',
},
preset: 'ts-jest',
testPathIgnorePatterns: ['node_modules', '/tst/snapshots/',],
testEnvironment: 'jsdom',
collectCoverage: true,
Expand All @@ -36,4 +32,7 @@ module.exports = {
* https://jestjs.io/docs/configuration#coverageprovider-string
*/
coverageProvider: 'v8',
transformIgnorePatterns: [
'node_modules/(?!uuid)',
],
};
Loading
Loading