Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Empty file.
2 changes: 1 addition & 1 deletion packages/timo-design-system/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const preview: Preview = {
},
options: {
storySort: {
order: ["Guides", "Components", "Icons"],
order: ["Guides", "Tokens", "Components", "Icons"],
},
},
actions: {
Expand Down
2 changes: 1 addition & 1 deletion packages/timo-design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"check-types": "tsc --noEmit",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"chromatic": "chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --only-changed"
"chromatic": "chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --only-changed --exit-zero-on-changes"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
Expand Down
Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

import { Color } from "./Color";
import { COLOR_TOKENS } from "../../tokens/colort-token";
Comment thread
kimminna marked this conversation as resolved.

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

const meta = {
title: "Tokens/Color",
parameters: {
layout: "padded",
},
} satisfies Meta;

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

export const All: Story = {
name: "All Colors",
render: () => (
<div style={{ fontFamily: "sans-serif", maxWidth: "600px" }}>
<p style={{ fontSize: "12px", color: "#999", marginBottom: "16px" }}>
⚠️ 피그마 MCP 연동 후 실제 값으로 업데이트 예정입니다.
</p>
{COLOR_TOKENS.map((token) => (
<Color key={token.name} {...token} />
))}
</div>
Comment thread
kimminna marked this conversation as resolved.
),
};
42 changes: 42 additions & 0 deletions packages/timo-design-system/src/components/color/Color.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { ColorToken } from "../../tokens/colort-token";

export const Color = ({ name, cssVar, value, usage }: ColorToken) => {
Comment thread
kimminna marked this conversation as resolved.
return (
<div
style={{
display: "flex",
alignItems: "center",
gap: "16px",
padding: "12px 0",
borderBottom: "1px solid #f0f0f0",
}}
>
<div
style={{
width: "48px",
height: "48px",
borderRadius: "8px",
backgroundColor: value,
border: "1px solid #e0e0e0",
flexShrink: 0,
}}
/>
<div>
<div style={{ fontWeight: 600, fontSize: "14px" }}>{name}</div>
<div
style={{ fontSize: "12px", color: "#666", fontFamily: "monospace" }}
>
{cssVar}
</div>
<div
style={{ fontSize: "12px", color: "#666", fontFamily: "monospace" }}
>
{value}
</div>
<div style={{ fontSize: "12px", color: "#888", marginTop: "2px" }}>
{usage}
</div>
</div>
</div>
Comment thread
kimminna marked this conversation as resolved.
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

import { Typography } from "./Typography";
import { TYPOGRAPHY_TOKENS } from "../../tokens/typography-token";
Comment on lines +2 to +3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

스토리 import 경로를 절대 경로로 통일해 주세요.

스토리도 컴포넌트와 같은 규칙을 따라야 이후 생성기 출력과 Storybook alias가 자연스럽게 맞습니다. 상대 경로는 여기서 끊는 편이 좋습니다.

As per path instructions, 절대 경로 import 사용 (상대 경로 ../../ 지양).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/timo-design-system/src/components/typography/Typography.stories.tsx`
around lines 2 - 3, 스토리 파일의 import 경로가 상대 경로로 되어 있어 alias 규칙과 맞지 않으므로,
Typography.stories.tsx에서 Typography와 TYPOGRAPHY_TOKENS의 import를 모두 절대 경로 alias
방식으로 바꾸세요. 이 변경은 스토리에서도 컴포넌트와 동일한 import 규칙을 따르도록 하는 것으로, 해당 파일의 import 구문만 수정하면
됩니다.

Source: Path instructions


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

const meta = {
title: "Tokens/Typography",
parameters: {
layout: "padded",
},
} satisfies Meta;

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

export const Scale: Story = {
render: () => (
<div style={{ fontFamily: "sans-serif", maxWidth: "700px" }}>
<p style={{ fontSize: "12px", color: "#999", marginBottom: "24px" }}>
⚠️ 피그마 MCP 연동 후 실제 값으로 업데이트 예정입니다.
</p>
{TYPOGRAPHY_TOKENS.map((row) => (
<Typography key={row.token} {...row} />
))}
</div>
),
Comment thread
kimminna marked this conversation as resolved.
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { TypographyToken } from "../../tokens/typography-token";

export const Typography = ({ token, size, weight, usage }: TypographyToken) => {
Comment thread
kimminna marked this conversation as resolved.
return (
<div
style={{
display: "flex",
alignItems: "baseline",
gap: "24px",
padding: "16px 0",
borderBottom: "1px solid #f0f0f0",
}}
>
<div
style={{
fontSize: size,
fontWeight: weight,
minWidth: "200px",
color: "#171717",
}}
>
가나다라마 Aa
</div>
<div>
<div
style={{ fontSize: "12px", color: "#666", fontFamily: "monospace" }}
>
{token}
</div>
<div style={{ fontSize: "12px", color: "#888" }}>
{size} / {weight} — {usage}
</div>
</div>
</div>
Comment thread
kimminna marked this conversation as resolved.
);
};
27 changes: 27 additions & 0 deletions packages/timo-design-system/src/tokens/colort-token.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export interface ColorToken {
name: string;
cssVar: string;
value: string;
usage: string;
}

export const COLOR_TOKENS: ColorToken[] = [
{
name: "primary",
cssVar: "--color-primary",
value: "#111111",
usage: "브랜드 메인 (버튼, 강조)",
},
{
name: "background",
cssVar: "--color-background",
value: "#ffffff",
usage: "페이지 배경",
},
{
name: "foreground",
cssVar: "--color-foreground",
value: "#171717",
usage: "텍스트 기본",
},
];
15 changes: 15 additions & 0 deletions packages/timo-design-system/src/tokens/typography-token.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export interface TypographyToken {
token: string;
size: string;
weight: string;
usage: string;
}

export const TYPOGRAPHY_TOKENS: TypographyToken[] = [
{ token: "text-2xl", size: "24px", weight: "700", usage: "페이지 제목" },
{ token: "text-xl", size: "20px", weight: "600", usage: "섹션 제목" },
{ token: "text-lg", size: "18px", weight: "500", usage: "카드 제목" },
{ token: "text-base", size: "16px", weight: "400", usage: "본문 기본" },
{ token: "text-sm", size: "14px", weight: "400", usage: "보조 텍스트" },
{ token: "text-xs", size: "12px", weight: "400", usage: "캡션·레이블" },
];
9 changes: 7 additions & 2 deletions turbo/generators/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { PlopTypes } from "@turbo/gen";

export default function generator(plop: PlopTypes.NodePlopAPI): void {
plop.setGenerator("react-component", {
description: "packages/ui에 새 React 컴포넌트 추가",
description: "packages/timo-design-system에 새 React 컴포넌트 추가",
prompts: [
{
type: "input",
Expand All @@ -19,9 +19,14 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
actions: [
{
type: "add",
path: "packages/ui/src/{{pascalCase name}}.tsx",
path: "packages/timo-design-system/src/components/{{kebabCase name}}/{{pascalCase name}}.tsx",
templateFile: "templates/component/component.tsx.hbs",
},
{
type: "append",
path: "packages/timo-design-system/src/components/index.ts",
template: 'export { {{pascalCase name}} } from "./{{kebabCase name}}/{{pascalCase name}}";',
},
],
});

Expand Down
Loading