File tree Expand file tree Collapse file tree 6 files changed +30560
-45577
lines changed
Expand file tree Collapse file tree 6 files changed +30560
-45577
lines changed Original file line number Diff line number Diff line change 1- module . exports = {
2- "stories" : [
1+ import type { StorybookConfig } from '@storybook/react-vite' ;
2+
3+ const config : StorybookConfig = {
4+ stories : [
35 "../lib/**/*.stories.mdx" ,
46 "../lib/**/*.stories.@(js|jsx|ts|tsx)"
57 ] ,
6- " addons" : [
8+ addons : [
79 "@storybook/addon-links" ,
810 "@storybook/addon-essentials" ,
911 "@storybook/addon-a11y" ,
10- "@storybook/preset-create-react-app" ,
11- ]
12- } ;
12+ ] ,
13+ framework : {
14+ name : "@storybook/react-vite" ,
15+ options : { } ,
16+ } ,
17+ docs : {
18+ autodocs : "tag" ,
19+ } ,
20+ } ;
21+
22+ export default config ;
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ FROM node:16-alpine
33WORKDIR /app
44
55COPY package*.json ./
6- RUN yarn install && yarn build --ignore-scripts
6+ RUN npm install
77COPY . .
88
9- CMD chown node: -R node_modules && yarn storybook
9+ CMD chown node: -R node_modules && npm run storybook
1010
Original file line number Diff line number Diff line change 1- import { Story } from '@storybook/react' ;
1+ import type { Meta , StoryObj } from '@storybook/react' ;
22import React from 'react' ;
33
44import { ThemeName } from '../../themes' ;
5- import Button , { ButtonProps } from './Button' ;
5+ import Button from './Button' ;
66
7- export default {
7+ const meta : Meta < typeof Button > = {
88 title : 'Button' ,
99 component : Button ,
1010 decorators : [
11- ( Story : Story ) : React . ReactNode => (
11+ ( Story ) => (
1212 < div style = { { margin : 'auto' , maxWidth : 400 } } >
1313 < Story />
1414 </ div >
@@ -22,13 +22,16 @@ export default {
2222 } ,
2323} ;
2424
25- const Template : Story < ButtonProps > = props => < Button { ...props } /> ;
25+ export default meta ;
26+ type Story = StoryObj < typeof meta > ;
2627
27- export const Default = Template . bind ( { } ) ;
28- Default . args = { } ;
28+ export const Default : Story = {
29+ args : { } ,
30+ } ;
2931
30- export const OrangeTheme = Template . bind ( { } ) ;
31- OrangeTheme . args = {
32- theme : ThemeName . ORANGE ,
33- animation : 'invert' ,
32+ export const OrangeTheme : Story = {
33+ args : {
34+ theme : ThemeName . ORANGE ,
35+ animation : 'invert' ,
36+ } ,
3437} ;
You can’t perform that action at this time.
0 commit comments