Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
WakuwakuP committed Apr 23, 2024
1 parent 22a94ca commit 5dc7aae
Show file tree
Hide file tree
Showing 18 changed files with 1,127 additions and 2,325 deletions.
29 changes: 9 additions & 20 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
const { mergeConfig } = require('vite')
const path = require('path')
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')

module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: ['../public'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'],

framework: {
name: '@storybook/nextjs',
options: {},
},

features: {
storyStoreV7: true,
options: {
nextConfigPath: '../next.config.js',
builder: {
fsCache: true,
lazyCompilation: true,
},
},
},

webpackFinal(config) {
const { mergeConfig } = require('vite')
config.resolve.modules = [...(config.resolve.modules || []), path.resolve(__dirname, '../src')]

config.resolve.plugins = [...(config.resolve.plugins || []), new TsconfigPathsPlugin()]
return mergeConfig(config)
},

docs: {
autodocs: true,
automock: 'tag',
},
}
1 change: 0 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { IconContext } from 'react-icons'
import '../src/styles/globals.css'

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"chromatic": "chromatic --exit-zero-on-changes"
},
"dependencies": {
"@storybook/test": "8.0.9",
"@types/rss": "^0.0.32",
"@vercel/analytics": "^1.2.2",
"cheerio": "^1.0.0-rc.12",
Expand All @@ -34,20 +35,20 @@
"react-scroll": "^1.9.0",
"react-tsparticles": "^2.12.2",
"rss": "^1.2.2",
"storybook": "^7.6.17",
"storybook": "^8.0.9",
"tsparticles": "2.12.0",
"tsparticles-engine": "2.12.0",
"vercel": "^34.1.1"
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@storybook/addon-actions": "^7.6.17",
"@storybook/addon-essentials": "^7.6.17",
"@storybook/addon-interactions": "^7.6.17",
"@storybook/addon-links": "^7.6.17",
"@storybook/nextjs": "7.6.17",
"@storybook/react": "^7.6.17",
"@storybook/testing-library": "^0.2.2",
"@chromatic-com/storybook": "1",
"@storybook/addon-actions": "^8.0.9",
"@storybook/addon-essentials": "^8.0.9",
"@storybook/addon-interactions": "^8.0.9",
"@storybook/addon-links": "^8.0.9",
"@storybook/nextjs": "^8.0.9",
"@storybook/react": "^8.0.9",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.3",
"@types/gtag.js": "^0.0.19",
Expand Down
26 changes: 14 additions & 12 deletions src/components/containers/ContentCard/ContentCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { ContentCard } from './ContentCard'

import type { ComponentStory, ComponentMeta } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

export default {
title: 'containers/ContentCard',
export const meta: Meta<typeof ContentCard> = {
component: ContentCard,
args: {
content: {
Expand All @@ -15,19 +14,22 @@ export default {
{
id: 'aaa',
name: 'test category',
createdAt: '',
updatedAt: '',
publishedAt: '',
revisedAt: '',
},
],
contentsCategory: [],
createdAt: '',
updatedAt: '',
revisedAt: '',
},
},
argTypes: {
// TODO
},
} as ComponentMeta<typeof ContentCard>
}

const Template: ComponentStory<typeof ContentCard> = (args) => <ContentCard {...args} />
export default meta

export const Default = Template.bind({})
type story = StoryObj<typeof ContentCard>

Default.args = {
// TODO
}
export const Default: story = {}
18 changes: 6 additions & 12 deletions src/components/containers/Footer/Footer.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import { Footer } from './Footer'

import type { ComponentStory, ComponentMeta } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

export default {
title: 'containers/Footer',
const meta: Meta<typeof Footer> = {
component: Footer,
argTypes: {
// TODO
},
} as ComponentMeta<typeof Footer>
}

const Template: ComponentStory<typeof Footer> = () => <Footer />
export default meta

export const Default = Template.bind({})
type story = StoryObj<typeof Footer>

Default.args = {
// TODO
}
export const Default: story = {}
14 changes: 6 additions & 8 deletions src/components/containers/Header/Header.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import { Header } from './Header'

import type { ComponentStory, ComponentMeta } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

export default {
const meta: Meta<typeof Header> = {
title: 'containers/Header',
component: Header,
argTypes: {
// TODO
},
} as ComponentMeta<typeof Header>
}

const Template: ComponentStory<typeof Header> = () => <Header />
export default meta

export const Default = Template.bind({})
type story = StoryObj<typeof Header>

Default.args = {
// TODO
}
export const Default: story = {}
25 changes: 7 additions & 18 deletions src/components/containers/Pagination/Pagination.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
import { Pagination } from './Pagination'

import type { ComponentStory, ComponentMeta } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

export default {
title: 'containers/Pagination',
const meta: Meta<typeof Pagination> = {
component: Pagination,
args: {
totalPage: 20,
page: 5,
},
argTypes: {
totalPage: {
type: Number,
description: '最大ページ数',
control: 'number',
},
page: {
type: Number,
description: '現在のページ数',
control: 'number',
},
},
} as ComponentMeta<typeof Pagination>
}

export default meta

const Template: ComponentStory<typeof Pagination> = (args) => <Pagination {...args} />
type story = StoryObj<typeof Pagination>

export const Default = Template.bind({})
export const Default: story = {}
24 changes: 6 additions & 18 deletions src/components/containers/SiteTop/SiteTop.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
import React from 'react'

import { SiteTop } from './SiteTop'

import type { ComponentStory, ComponentMeta } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

export default {
title: 'containers/SiteTop',
const meta: Meta<typeof SiteTop> = {
component: SiteTop,
argTypes: {
// TODO
},
} as ComponentMeta<typeof SiteTop>
}

const Template: ComponentStory<typeof SiteTop> = (args) => (
<div style={{ height: 100 + 'vh' }}>
<SiteTop {...args} />
</div>
)
export default meta

export const Default = Template.bind({})
type story = StoryObj<typeof SiteTop>

Default.args = {
// TODO
}
export const Default: story = {}
20 changes: 6 additions & 14 deletions src/components/containers/Toc/Toc.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import React from 'react'

import { Toc } from './Toc'

import type { ComponentStory, ComponentMeta } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

export default {
title: 'containers/Toc',
const meta: Meta<typeof Toc> = {
component: Toc,
args: {
toc: [
Expand All @@ -31,15 +28,10 @@ export default {
},
],
},
argTypes: {
// TODO
},
} as ComponentMeta<typeof Toc>
}

const Template: ComponentStory<typeof Toc> = (args) => <Toc {...args} />
export default meta

export const Default = Template.bind({})
type story = StoryObj<typeof Toc>

Default.args = {
// TODO
}
export const Default: story = {}
58 changes: 29 additions & 29 deletions src/components/parts/IconButton/IconButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@ import { SiTwitter } from 'react-icons/si'

import { IconButton } from './IconButton'

import type { ComponentStory, ComponentMeta } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

export default {
title: 'parts/IconButton',
const meta: Meta<typeof IconButton> = {
component: IconButton,
argTypes: {
// TODO
},
} as ComponentMeta<typeof IconButton>

const Template1: ComponentStory<typeof IconButton> = (args) => {
return (
<ul>
<IconButton {...args}>
<SiTwitter size={'2rem'} />
</IconButton>
</ul>
)
}

export const Default = Template1.bind({})
export default meta

type story = StoryObj<typeof IconButton>

const Template2: ComponentStory<typeof IconButton> = (args) => {
return (
<ul>
<IconButton {...args}>
<SiTwitter size={'2rem'} />
</IconButton>
<IconButton {...args}>
<SiTwitter size={'2rem'} />
</IconButton>
</ul>
)
export const Template1: story = {
render: (args) => {
return (
<ul>
<IconButton {...args}>
<SiTwitter size={'2rem'} />
</IconButton>
</ul>
)
},
}

export const List = Template2.bind({})
export const Template2: story = {
render: (args) => {
return (
<ul>
<IconButton {...args}>
<SiTwitter size={'2rem'} />
</IconButton>
<IconButton {...args}>
<SiTwitter size={'2rem'} />
</IconButton>
</ul>
)
},
}
20 changes: 6 additions & 14 deletions src/components/parts/PageTitle/PageTitle.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
import React from 'react'

import { PageTitle } from './PageTitle'

import type { ComponentStory, ComponentMeta } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

export default {
title: 'parts/PageTitle',
const meta: Meta<typeof PageTitle> = {
component: PageTitle,
args: {
bgText: 'blog',
children: 'TEST',
},
argTypes: {
// TODO
},
} as ComponentMeta<typeof PageTitle>
}

const Template: ComponentStory<typeof PageTitle> = (args) => <PageTitle {...args} />
export default meta

export const Default = Template.bind({})
type story = StoryObj<typeof PageTitle>

Default.args = {
// TODO
}
export const Default: story = {}
Loading

0 comments on commit 5dc7aae

Please sign in to comment.