11import type { Meta , StoryObj } from '@storybook/react-vite' ;
22
3- import Mandalart , { type Cycle } from './Mandalart' ;
3+ import Mandalart from './Mandalart' ;
44import { MOCK_MANDALART_DATA } from './mock' ;
55
66const meta = {
@@ -13,95 +13,65 @@ const meta = {
1313 } ,
1414 } ,
1515 tags : [ 'autodocs' ] ,
16+ argTypes : {
17+ type : {
18+ control : 'select' ,
19+ options : [ 'TODO_SUB' , 'TODO_MAIN' , 'TODO_EDIT' , 'MY_MANDAL' ] ,
20+ } ,
21+ } ,
1622} satisfies Meta < typeof Mandalart > ;
1723
1824export default meta ;
1925type Story = StoryObj < typeof meta > ;
2026
21- const CUSTOM_GOALS = {
22- mainGoal : '나인도트 1등하기' ,
23- subGoals : [
24- {
25- title : '이현준 갈구기' ,
26- position : 0 ,
27- cycle : 'DAILY' as Cycle ,
28- } ,
29- {
30- title : '매일 운동하기' ,
31- position : 1 ,
32- cycle : 'DAILY' as Cycle ,
33- } ,
34- {
35- title : '일찍 일어나기' ,
36- position : 2 ,
37- cycle : 'DAILY' as Cycle ,
38- } ,
39- {
40- title : '계획 세우기' ,
41- position : 3 ,
42- cycle : 'WEEKLY' as Cycle ,
43- } ,
44- {
45- title : '시간 관리하기' ,
46- position : 4 ,
47- cycle : 'WEEKLY' as Cycle ,
48- } ,
49- {
50- title : '건강 관리하기' ,
51- position : 5 ,
52- cycle : 'DAILY' as Cycle ,
53- } ,
54- {
55- title : '긍정적으로 생각하기' ,
56- position : 6 ,
57- cycle : 'DAILY' as Cycle ,
58- } ,
59- {
60- title : '꾸준히 노력하기' ,
61- position : 7 ,
62- cycle : 'DAILY' as Cycle ,
63- } ,
64- ] ,
65- completedGoals : [ 1 , 3 , 5 ] ,
27+ export const Default : Story = {
28+ args : {
29+ mainGoal : MOCK_MANDALART_DATA . mainGoal ,
30+ subGoals : MOCK_MANDALART_DATA . subGoals ,
31+ type : 'TODO_MAIN' ,
32+ } ,
6633} ;
6734
68- export const Default : Story = {
35+ export const AllTypes : Story = {
6936 args : {
70- mainGoal : '메인 목표를 입력하세요' ,
37+ mainGoal : MOCK_MANDALART_DATA . mainGoal ,
7138 subGoals : MOCK_MANDALART_DATA . subGoals ,
39+ type : 'TODO_MAIN' ,
7240 } ,
73- render : ( args ) => (
74- < div style = { { display : 'flex' , gap : '2rem ' } } >
41+ render : ( ) => (
42+ < div style = { { display : 'flex' , flexDirection : 'column' , gap : '4rem ' } } >
7543 < div >
76- < h3 style = { { color : 'white' , marginBottom : '1rem' } } > Default 사이즈</ h3 >
77- < Mandalart { ...args } />
44+ < h3 style = { { marginBottom : '1rem' } } > TODO_SUB (96px)</ h3 >
45+ < Mandalart
46+ mainGoal = { MOCK_MANDALART_DATA . mainGoal }
47+ subGoals = { MOCK_MANDALART_DATA . subGoals }
48+ type = "TODO_SUB"
49+ />
7850 </ div >
7951 < div >
80- < h3 style = { { color : 'white' , marginBottom : '1rem' } } > Small 사이즈</ h3 >
81- < Mandalart { ...args } size = "small" />
52+ < h3 style = { { marginBottom : '1rem' } } > TODO_MAIN (196px)</ h3 >
53+ < Mandalart
54+ mainGoal = { MOCK_MANDALART_DATA . mainGoal }
55+ subGoals = { MOCK_MANDALART_DATA . subGoals }
56+ type = "TODO_MAIN"
57+ />
58+ </ div >
59+ < div >
60+ < h3 style = { { marginBottom : '1rem' } } > TODO_EDIT (160px)</ h3 >
61+ < Mandalart
62+ mainGoal = { MOCK_MANDALART_DATA . mainGoal }
63+ subGoals = { MOCK_MANDALART_DATA . subGoals }
64+ type = "TODO_EDIT"
65+ />
66+ </ div >
67+ < div >
68+ < h3 style = { { marginBottom : '1rem' } } > MY_MANDAL (298px)</ h3 >
69+ < Mandalart
70+ mainGoal = { MOCK_MANDALART_DATA . mainGoal }
71+ subGoals = { MOCK_MANDALART_DATA . subGoals }
72+ type = "MY_MANDAL"
73+ />
8274 </ div >
8375 </ div >
8476 ) ,
8577} ;
86-
87- export const Small : Story = {
88- args : {
89- mainGoal : '메인 목표를 입력하세요' ,
90- subGoals : CUSTOM_GOALS . subGoals ,
91- size : 'small' ,
92- } ,
93- render : ( args ) => < Mandalart { ...args } /> ,
94- } ;
95-
96- export const WithCustomGoals : Story = {
97- args : CUSTOM_GOALS ,
98- render : ( args ) => < Mandalart { ...args } /> ,
99- } ;
100-
101- export const WithCustomGoalsSmall : Story = {
102- args : {
103- ...CUSTOM_GOALS ,
104- size : 'small' ,
105- } ,
106- render : ( args ) => < Mandalart { ...args } /> ,
107- } ;
0 commit comments