Skip to content

Commit

Permalink
Merge pull request #256 from nekochans/feature/issue255/upgrade-story…
Browse files Browse the repository at this point in the history
…book

Storybookを7系の最新安定版に更新
  • Loading branch information
keitakn authored Aug 13, 2023
2 parents b08b6bf + dbb3148 commit a4c2099
Show file tree
Hide file tree
Showing 10 changed files with 21,476 additions and 37,132 deletions.
14 changes: 0 additions & 14 deletions .storybook/main.js

This file was deleted.

20 changes: 20 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { StorybookConfig } from '@storybook/nextjs';

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/nextjs',
options: {},
},
docs: {
autodocs: 'tag',
},
staticDirs: ['../public'],
};
export default config;
87 changes: 0 additions & 87 deletions .storybook/preview.js

This file was deleted.

53 changes: 53 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import type { Preview } from '@storybook/react';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { initialize, mswDecorator } from 'msw-storybook-addon';

initialize();

export const decorators = [mswDecorator];

const customViewports = {
iPhone11ProMax: {
name: 'iPhone 11 Pro Max',
styles: {
width: '414px',
height: '896px',
},
},
iPhone13ProMax: {
name: 'iPhone 13 Pro Max',
styles: {
width: '428px',
height: '926px',
},
},
googlePixel3: {
name: 'Google Pixel 3',
styles: {
width: '411px',
height: '823px',
},
},
googlePixel5: {
name: 'Google Pixel 5',
styles: {
width: '393px',
height: '851px',
},
},
};

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
viewport: { viewports: { ...INITIAL_VIEWPORTS, ...customViewports } },
},
};

export default preview;
Loading

1 comment on commit a4c2099

@vercel
Copy link

@vercel vercel bot commented on a4c2099 Aug 13, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.