Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook documentation/#110 #111

Merged
merged 28 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
71abd47
docs: documentation avatar story
gahyuun May 24, 2024
480ea25
docs: modify button story description
gahyuun May 24, 2024
44b0a6e
docs: modify label container path
gahyuun May 24, 2024
7d7468f
docs: delete avatar story args
gahyuun May 24, 2024
aaf2f81
docs: documentation textinput story
gahyuun May 24, 2024
3a7e868
docs: documentation alert destructive story
gahyuun May 24, 2024
d306da0
docs: documentation announce message box story
gahyuun May 24, 2024
85e38cf
docs: documentation drawer story
gahyuun May 24, 2024
7087544
docs: documentation form story
gahyuun May 24, 2024
fa0aea1
chore: delete unnecessary import
gahyuun May 24, 2024
9e30d00
docs: documentation grid story
gahyuun May 24, 2024
b0f500e
chore: change type to interface
gahyuun May 24, 2024
249ec31
docs: documentation list story
gahyuun May 24, 2024
a80abf3
remove: delete avatar story
gahyuun May 25, 2024
dd452ac
docs: add argTypes
gahyuun May 25, 2024
ae062ba
chore: delete example code
gahyuun May 25, 2024
e3d0e98
remove: remove content-container
gahyuun May 25, 2024
6e9f6eb
chore: change labelcontainer name
gahyuun May 25, 2024
92fb7ed
docs: documentation content-container story
gahyuun May 25, 2024
8c39374
docs: documentation loading spinner story
gahyuun May 25, 2024
720108f
remove: make loading spinner folder
gahyuun May 25, 2024
317a48c
docs: add argTypes
gahyuun May 25, 2024
09a24f8
docs: documentation modal story
gahyuun May 25, 2024
d93aec2
docs: documentation pie chart story
gahyuun May 25, 2024
86a4ea4
docs: documentation select story
gahyuun May 25, 2024
57955b5
chore: add form component description
gahyuun May 25, 2024
a07d1b1
docs: documentation table story
gahyuun May 25, 2024
5fb52fb
docs: documentation upload pdf story
gahyuun May 25, 2024
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
2 changes: 1 addition & 1 deletion app/(sub-page)/grade-upload/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ContentContainer from '../../ui/view/atom/content-container';
import ContentContainer from '../../ui/view/atom/content-container/content-container';
import Manual from './components/manual';
import UploadTakenLecture from '../../ui/lecture/upload-taken-lecture/upload-taken-lecture';

Expand Down
4 changes: 2 additions & 2 deletions app/(sub-page)/my/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import LectureSearch from '@/app/ui/lecture/lecture-search';
import TakenLecture from '@/app/ui/lecture/taken-lecture';
import UserInfoNavigator from '@/app/ui/user/user-info-navigator/user-info-navigator';
import UserInfoNavigatorSkeleton from '@/app/ui/user/user-info-navigator/user-info-navigator.skeleton';
import ContentContainer from '@/app/ui/view/atom/content-container';
import Drawer from '@/app/ui/view/molecule/drawer/drawer';
import { DIALOG_KEY } from '@/app/utils/key/dialog-key.util';
import { Suspense } from 'react';
import MyResultContainer from './components/my-result-container';
import SignButtonGroup from '@/app/ui/user/user-info-navigator/sign-button-group';
import Responsive from '@/app/ui/responsive';
import TakenLectureSkeleton from '@/app/ui/lecture/taken-lecture/taken-lecture-skeleton';
import ContentContainer from '@/app/ui/view/atom/content-container/content-container';
import TakenLectureSkeleton from '@/app/ui/lecture/taken-lecture/taken-lecture.skeleton';

export default function MyPage() {
return (
Expand Down
2 changes: 1 addition & 1 deletion app/(sub-page)/result/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import UserInfoCard from '@/app/ui/user/user-info-card/user-info-card';
import ContentContainer from '@/app/ui/view/atom/content-container';
import ResultCategoryDetail from '@/app/ui/result/result-category-detail/result-category-detail';
import { Suspense } from 'react';
import UserInfoCardSkeleton from '@/app/ui/user/user-info-card/user-info-card.skeleton';
import ResultCategory from '@/app/ui/result/result-category/result-category';
import ResultCategorySkeleton from '@/app/ui/result/result-category/result-category.skeleton';
import ContentContainer from '@/app/ui/view/atom/content-container/content-container';

interface ResultPageProp {
searchParams: { category: string };
Expand Down
2 changes: 1 addition & 1 deletion app/(sub-page)/sign-in/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ContentContainer from '@/app/ui/view/atom/content-container';
import SignInForm from '@/app/ui/user/sign-in-form/sign-in-form';
import ContentContainer from '@/app/ui/view/atom/content-container/content-container';

export default function Page() {
return (
Expand Down
1 change: 0 additions & 1 deletion app/(sub-page)/sign-up/components/sign-up-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import useFunnel from '@/app/hooks/useFunnel';
import SignUpForm from '@/app/ui/user/sign-up-form/sign-up-form';
import SignUpTerm from './sign-up-terms';
import SignUpSuccess from './sign-up-success';
import ContentContainer from '@/app/ui/view/atom/content-container';

export default function SignUpContainer() {
const { Funnel, setStep } = useFunnel<'terms' | 'form' | 'success'>('terms');
Expand Down
4 changes: 2 additions & 2 deletions app/(sub-page)/sign-up/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ContentContainer from '@/app/ui/view/atom/content-container';
import SignUpContainer from './components/sign-up-container';
import { Suspense } from 'react';
import LoadingSpinner from '@/app/ui/view/atom/loading-spinner';
import ContentContainer from '@/app/ui/view/atom/content-container/content-container';
import LoadingSpinner from '@/app/ui/view/atom/loading-spinner/loading-spinner';

// Refactor: fallback ์Šค์ผˆ๋ ˆํ†ค์œผ๋กœ ๋Œ€์ฒด
export default function Page() {
Expand Down
29 changes: 0 additions & 29 deletions app/dashboard/components/dashboard-nav-links.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions app/dashboard/components/side-nav.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions app/dashboard/invoices/page.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions app/dashboard/layout.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions app/dashboard/loading.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions app/dashboard/page.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion app/ui/lecture/lecture-search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Suspense } from 'react';
import Image from 'next/image';
import searchResultIcon from '@/public/assets/searchResultIcon.svg';
import List from '../../view/molecule/list';
import LoadingSpinner from '../../view/atom/loading-spinner';
import LoadingSpinner from '../../view/atom/loading-spinner/loading-spinner';
import LectureSearchResult from './lecture-search-result';

const emptyDataRender = () => {
Expand Down
5 changes: 2 additions & 3 deletions app/ui/user/user-info-navigator/user-info-navigator.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { UserInfoResponseSchema } from '@/app/business/user/user.validation';
import Avatar from '../../view/atom/avatar/avatar';
import { auth, fetchUserInfo } from '@/app/business/user/user.query';
import { auth } from '@/app/business/user/user.query';
import { isInitUser } from '@/app/business/user/user.validation';
import { InitUserInfoResponse, UserInfoResponse } from '@/app/business/user/user.type';
import Avatar from '../../view/atom/avatar';

function formatUserInfo(userInfo: InitUserInfoResponse | UserInfoResponse | undefined): {
name: string;
Expand Down
File renamed without changes.
17 changes: 0 additions & 17 deletions app/ui/view/atom/avatar/avatar.stories.tsx

This file was deleted.

25 changes: 12 additions & 13 deletions app/ui/view/atom/button/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@ const meta = {
title: 'ui/view/atom/Button',
component: Button,
tags: ['autodocs'],
parameters: {
componentSubtitle: 'Button์€ ์‚ฌ์šฉ์ž๊ฐ€ ํ•œ ๋ฒˆ์˜ ํƒญ์œผ๋กœ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๊ณ  ์„ ํƒํ•  ์ˆ˜ ์žˆ๋Š” ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค.',
docs: {
description: {
component: `
- variant๊ฐ’์œผ๋กœ "primary" | "secondary" | "list" | "outlined" ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.\n
- size๊ฐ’์œผ๋กœ "lg" | "md" | "sm" | "xs" | "default" ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.\n
- label ๊ฐ’์œผ๋กœ button ํƒœ๊ทธ์— ์กด์žฌํ•˜๋Š” text๋ฅผ ์˜๋ฏธํ•˜๊ณ  ํ•„์ˆ˜์ ์œผ๋กœ ํ• ๋‹นํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค
`,
},
},
},
argTypes: {
variant: {
description: 'Button์˜ Variant๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.',
Expand Down Expand Up @@ -47,6 +35,17 @@ const meta = {
defaultValue: { summary: '' },
},
},
loading: {
description: 'Button์˜ loading ์—ฌ๋ถ€๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค',
table: {
type: { summary: 'ButtonSize' },
defaultValue: { summary: 'md' },
},
options: [true, false],
control: {
type: 'radio',
},
},
},
} satisfies Meta<typeof Button>;

Expand Down Expand Up @@ -81,7 +80,7 @@ export const ListActionButton: Story = {
args: {
size: 'default',
variant: 'list',
label: '์‚ญ์ œ',
label: '์ถ”๊ฐ€',
},
};

Expand Down
2 changes: 1 addition & 1 deletion app/ui/view/atom/button/button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cn } from '@/app/utils/shadcn/utils';
import { cva } from 'class-variance-authority';
import React from 'react';
import LoadingSpinner from '../loading-spinner';
import LoadingSpinner from '../loading-spinner/loading-spinner';

export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'default' | 'xl';

Expand Down
50 changes: 50 additions & 0 deletions app/ui/view/atom/content-container/content-cotainer.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import type { Meta, StoryObj } from '@storybook/react';
import ContentContainer from './content-container';
import background from '../../../../../public/assets/background.png';
import Image from 'next/image';

const meta = {
title: 'ui/view/atom/ContentContainer',
component: ContentContainer,
tags: ['autodocs'],
parameters: {
componentSubtitle: 'ํŽ˜์ด์ง€ ๋ ˆ์ด์•„์›ƒ์„ ์„ค์ •ํ•˜๋Š”๋ฐ ์‚ฌ์šฉ๋˜๋Š” ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค',
},
argTypes: {
children: {
description: 'container ๋‚ด๋ถ€ ๋“ค์–ด๊ฐˆ ์ปดํฌ๋„ŒํŠธ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.',
},
size: {
description: 'ContentContainer์˜ size๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.',
table: {
type: { summary: 'ContentContainerSize' },
defaultValue: { summary: 'md' },
},
options: ['lg', 'md'],
control: {
type: 'radio',
},
},
className: {
description: '์ถ”๊ฐ€์ ์ธ ์Šคํƒ€์ผ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค',
},
},
} satisfies Meta<typeof ContentContainer>;

export default meta;
type Story = StoryObj<typeof meta>;

export const PrimaryButton: Story = {
args: {
size: 'md',
children: <div className="h-40"></div>,
},
render: (args) => (
<>
<Image src={background} width={800} height={288} className="w-full bg-white h-[18rem]" alt="background" />
<div className="flex justify-center">
<ContentContainer {...args} />
</div>
</>
),
};
20 changes: 10 additions & 10 deletions app/ui/view/atom/label-container/label-container.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import LabelContainer from './label-container';
import Button from '../button/button';

const meta = {
title: 'ui/view/atom/Button',
title: 'ui/view/atom/LabelContainer',
component: LabelContainer,
tags: ['autodocs'],
parameters: {
componentSubtitle: 'LabelContainer๋Š” ๊ธฐ์ด์ˆ˜, ๋ฏธ์ด์ˆ˜ ๊ณผ๋ชฉ์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ๋‚˜ํƒ€๋‚ผ ๋•Œ ์‚ฌ์šฉ๋˜๋Š” view component์ž…๋‹ˆ๋‹ค.',
docs: {
description: {
component: `
- label ๊ฐ’์œผ๋กœ ํ™”๋ฉด์— ์ถœ๋ ฅํ•˜๊ณ  ์‹ถ์€ text๋ฅผ ํ• ๋‹นํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. \n
- right element ๊ฐ’์œผ๋กœ ์˜ค๋ฅธ์ชฝ์— ๋ Œ๋”๋ง ๋  ์š”์†Œ๋ฅผ ํ• ๋‹นํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. \n
`,
},
},
argTypes: {
label: {
description: 'ํ™”๋ฉด์— ์ถœ๋ ฅํ•˜๊ณ  ์‹ถ์€ text๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค',
},
rightElement: {
description: '์˜ค๋ฅธ์ชฝ์— ๋ Œ๋”๋ง ๋  ์š”์†Œ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค',
},
},
} satisfies Meta<typeof LabelContainer>;
Expand All @@ -27,8 +27,8 @@ export const TakenLectureLabel: StoryObj<typeof LabelContainer> = {
label: '๋‚ด ๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ',
rightElement: (
<div className="flex gap-2">
<Button label="์ปค์Šคํ…€ํ•˜๊ธฐ" variant="secondary" size="md" />
<Button label="์—…๋ฐ์ดํŠธ" variant="secondary" size="md" />
<Button label="์ปค์Šคํ…€ํ•˜๊ธฐ" variant="secondary" size="xs" />
<Button label="์—…๋ฐ์ดํŠธ" variant="secondary" size="xs" />
</div>
),
},
Expand Down
25 changes: 25 additions & 0 deletions app/ui/view/atom/loading-spinner/loading-spinner.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import LoadingSpinner from './loading-spinner';

const meta = {
title: 'ui/view/atom/LoadingSpinner',
component: LoadingSpinner,
tags: ['autodocs'],
parameters: {
componentSubtitle: 'LoadingSpinner๋Š” ๋กœ๋”ฉ์„ ๋‚˜ํƒ€๋‚ผ ๋•Œ ์‚ฌ์šฉ๋˜๋Š” spinner ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค',
},
} satisfies Meta<typeof LoadingSpinner>;

export default meta;

export const Default: StoryObj<typeof LoadingSpinner> = {
render: () => (
<div className="w-100 h-100">
<LoadingSpinner
className={'animate-spin shrink-0 h-12 w-12 mr-1.5 -ml-1 fill-gray-400'}
style={{ transition: `width 150ms` }}
/>
</div>
),
};
28 changes: 0 additions & 28 deletions app/ui/view/atom/nav-link.tsx

This file was deleted.

Loading
Loading