Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5e21bc2
chore(ui): Storybook 의존성 및 실행 스크립트 추가 (#14)
yumin-kim2 Jun 25, 2026
26b440c
chore(ui): Storybook 기본 설정 추가 (#14)
yumin-kim2 Jun 25, 2026
9371293
chore(ui): Storybook 확인용 스토리 추가 (#14)
yumin-kim2 Jun 25, 2026
a6804c1
chore(root): Storybook 실행 스크립트 간소화 (#14)
yumin-kim2 Jun 25, 2026
d8196aa
chore(ui): Storybook 설정 주석 제거 (#14)
yumin-kim2 Jun 26, 2026
ba3234e
chore(ui): Storybook 접근성 addon 추가 (#14)
yumin-kim2 Jun 26, 2026
7ef42d9
chore(ui): develop 최신 변경사항 병합 (#14)
yumin-kim2 Jun 26, 2026
4f9a479
chore(ui): Storybook 문서화 addon 구성 (#14)
yumin-kim2 Jun 27, 2026
143441f
docs(ui): Storybook 작성 가이드 추가 (#14)
yumin-kim2 Jun 27, 2026
ad16210
chore(ui): Storybook preview 옵션 보강 (#14)
yumin-kim2 Jun 27, 2026
8e77421
ci(ui): Chromatic 배포 워크플로우 추가 (#14)
yumin-kim2 Jun 27, 2026
218a3c0
merge: develop 브랜치 병합 (#14)
yumin-kim2 Jun 27, 2026
f83dfad
feat(ui): Storybook 예시 Button 컴포넌트 추가 (#14)
yumin-kim2 Jun 27, 2026
fcdaf03
chore(ui): Storybook 및 Chromatic 설정 리뷰 반영 (#14)
yumin-kim2 Jun 27, 2026
1110548
fix(ui): Storybook 타입 및 Chromatic 변경 감지 설정 수정 (#14)
yumin-kim2 Jun 27, 2026
a00bff3
chore(root): Storybook 빌드 산출물 gitignore 추가 (#14)
yumin-kim2 Jun 27, 2026
e9239e7
chore(ui): Chromatic 변경 스토리만 검사하도록 설정 (#14)
yumin-kim2 Jun 27, 2026
14d7239
chore(ui): Chromatic 리뷰 반영 (#14)
yumin-kim2 Jun 27, 2026
8adfc30
chore(fix): pull-requests write로 변경 (#14)
yumin-kim2 Jun 28, 2026
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
40 changes: 40 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Chromatic

on:
pull_request:
branches:
- develop
paths:
- "packages/timo-design-system/**"
- ".github/workflows/chromatic.yml"
- "pnpm-lock.yaml"
Comment thread
yumin-kim2 marked this conversation as resolved.
Resolved
jobs:
chromatic:
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
persist-credentials: false

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Publish to Chromatic
run: pnpm chromatic
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ yarn-error.log*
# Misc
.DS_Store
*.pem

# Storybook build output
packages/timo-design-system/storybook-static/
packages/timo-design-system/build-storybook.log
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"build:web": "turbo run build --filter=timo-web",
"dev": "turbo run dev",
"dev:web": "turbo run dev --filter=timo-web",
"storybook": "pnpm --filter @repo/timo-design-system storybook",
"build-storybook": "pnpm --filter @repo/timo-design-system build-storybook",
"chromatic": "pnpm --filter @repo/timo-design-system chromatic",
"lint": "turbo run lint",
"lint:web": "turbo run lint --filter=timo-web",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
Expand Down
20 changes: 20 additions & 0 deletions packages/timo-design-system/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-a11y",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
};

export default config;
45 changes: 45 additions & 0 deletions packages/timo-design-system/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import type { Preview } from "@storybook/react-vite";

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
Comment thread
yumin-kim2 marked this conversation as resolved.
Resolved
},
viewport: {
viewports: {
mobile: { name: "Mobile", styles: { width: "375px", height: "812px" } },
tablet: {
name: "Tablet",
styles: { width: "768px", height: "1024px" },
},
desktop: {
name: "Desktop",
styles: { width: "1280px", height: "900px" },
},
},
defaultViewport: "desktop",
},
layout: "centered",
backgrounds: {
default: "white",
values: [
{ name: "white", value: "#ffffff" },
{ name: "gray", value: "#f5f5f5" },
{ name: "dark", value: "#1f1f1f" },
],
},
options: {
storySort: {
order: ["Guides", "Components", "Icons"],
},
},
actions: {
argTypesRegex: "^on[A-Z].*",
},
},
};

export default preview;
14 changes: 13 additions & 1 deletion packages/timo-design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,27 @@
"scripts": {
"lint": "eslint . --max-warnings 0",
"generate:component": "turbo gen react-component",
"check-types": "tsc --noEmit"
"check-types": "tsc --noEmit",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"chromatic": "chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --exit-zero-on-changes"
Comment thread
yumin-kim2 marked this conversation as resolved.
Resolved
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@storybook/addon-a11y": "^8.6.14",
"@storybook/addon-docs": "8.6.14",
"@storybook/addon-essentials": "8.6.14",
"@storybook/addon-interactions": "8.6.14",
"@storybook/addon-links": "^8.6.14",
"@storybook/react": "8.6.14",
"@storybook/react-vite": "^8.6.14",
"@types/node": "^22.15.3",
"@types/react": "19.2.2",
"@types/react-dom": "19.2.2",
"chromatic": "^17.7.2",
"eslint": "^9.39.1",
"storybook": "^8.6.14",
"typescript": "5.9.2"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Button } from "./Button";

import type { Meta, StoryObj } from "@storybook/react";


const meta = {
title: "Components/Button",
component: Button,
tags: ["autodocs"],
args: {
children: "Button",
},
argTypes: {
onClick: { action: "clicked" },
},
} satisfies Meta<typeof Button>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {};

export const Disabled: Story = {
args: {
disabled: true,
children: "Disabled",
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { ButtonHTMLAttributes } from "react";

type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement>;

export const Button = ({ children, ...props }: ButtonProps) => {
return <button {...props}>{children}</button>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Button } from "./Button";
74 changes: 74 additions & 0 deletions packages/timo-design-system/src/guides/StorybookGuide.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { Meta } from "@storybook/addon-docs/blocks";

<Meta title="Guides/Storybook Guide" />

# Storybook Guide

Timo Design System의 공통 UI 컴포넌트는 Storybook을 통해 상태별 예시와 사용 방법을 문서화합니다.

## Story 위치

컴포넌트 story는 컴포넌트와 같은 폴더에 작성합니다.

```txt
components/
Button/
Button.tsx
Button.stories.tsx
index.ts
```

## 파일 네이밍

Story 파일은 `ComponentName.stories.tsx` 형식을 사용합니다.

```txt
Button.stories.tsx
Input.stories.tsx
```

## 기본 Story 작성 예시

```tsx
import type { Meta, StoryObj } from "@storybook/react-vite";
import { Button } from "./Button";

const meta: Meta<typeof Button> = {
title: "Components/Button",
component: Button,
tags: ["autodocs"],
};

export default meta;

type Story = StoryObj<typeof Button>;

export const Default: Story = {
args: {
children: "Button",
},
};
```

## Autodocs

컴포넌트 문서를 자동 생성하려면 story meta에 `tags: ["autodocs"]`를 추가합니다.

```tsx
const meta: Meta<typeof Button> = {
title: "Components/Button",
component: Button,
tags: ["autodocs"],
};
```

## Accessibility

접근성 검사는 Storybook 하단 패널의 `Accessibility` 탭에서 확인합니다.

## Storybook 화면 구성

- Sidebar: 등록된 story 목록을 확인합니다.
- Canvas: 선택한 story가 렌더링되는 영역입니다.
- Toolbar: viewport, zoom 등을 조정합니다.
- Addons panel: Controls, Actions, Accessibility 결과를 확인합니다.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Loading
Loading