Skip to content

[FEAT] DeleteButton 컴포넌트 추가#80

Open
jjangminii wants to merge 2 commits into
developfrom
feat/ui/77-delete-button
Open

[FEAT] DeleteButton 컴포넌트 추가#80
jjangminii wants to merge 2 commits into
developfrom
feat/ui/77-delete-button

Conversation

@jjangminii

@jjangminii jjangminii commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

ISSUE 🔗

close #77



What is this PR? 🔍

트래시 아이콘과 "삭제하기" 텍스트로 구성된 DeleteButton 컴포넌트를 디자인 시스템에 추가했습니다.

배경

  • 기존 구조: 디자인 시스템에 삭제 동작을 위한 전용 버튼이 없었습니다.
  • 발생 문제: 피그마 스펙(W Hug 80px, H Hug 33px, 패딩 6px, 아이콘-텍스트 gap 2px, 폰트 headline-r-14)을 그대로 구현했을 때, hug(w-fit) 방식으로는 브라우저에서 실제 렌더링된 너비가 78.72px로 나와 Figma가 보여주는 80px과 차이가 났습니다.
  • 해결 방향: hug 대신 Figma가 최종적으로 계산한 값(80×33)을 고정 크기로 박아, 렌더러 간 텍스트 측정 방식 차이와 무관하게 디자인 스펙과 정확히 일치하도록 했습니다.

DeleteButton 컴포넌트

  • 변경 요약: onClick만 받는 단순한 컴포넌트로 구현했습니다. 기본 상태는 흰 배경 + 검은 아이콘/텍스트, :active(누르고 있는 동안)에는 파란 배경(timo-blue-300) + 흰 아이콘/텍스트로 전환됩니다.
  • 이유: "클릭했을 때" 파란 상태는 클릭을 확정하는 별도 모드가 아니라 누르는 순간에만 보이는 시각 피드백이라, 별도 prop 없이 CSS :active 의사 클래스로 처리하는 게 더 단순합니다.
  • 구현 방식: 크기는 h-8.25 w-20(33×80px)로 고정하고, 내부는 flex items-center gap-0.5 p-1.5로 아이콘·텍스트를 배치합니다. TrashOnIcon은 SVG 내부 fillcurrentColor가 아니라 #3F3F3F로 고정돼 있어서, 텍스트 색상 클래스만으로는 :active 시 흰색으로 바뀌지 않습니다. 그래서 active:[&_path]:fill-white 임의 선택자로 버튼이 active 상태일 때 아이콘 내부 path의 fill을 직접 덮어썼습니다.
  • 경계 · 제약: 아이콘 SVG가 currentColor를 쓰지 않는 문제는 이 컴포넌트에서 임시로 우회했을 뿐이라, 다른 컴포넌트에서도 아이콘 색상을 상태별로 바꿔야 한다면 SVGR 설정에서 fill="currentColor"로 통일하는 방향을 별도로 검토할 필요가 있습니다.



To Reviewers

active:[&_path]:fill-white 처럼 SVG 내부 요소를 Tailwind 임의 선택자로 직접 건드리는 방식이 이 정도 스코프에서 적절한지 봐주세요. 아이콘을 currentColor 기반으로 통일하는 큰 리팩터링은 이번 PR 범위 밖입니다.

같은 브랜치 작업 중 발견한 Scrollbar.stories.tsx의 임의값 클래스(w-[340px] 등)를 Tailwind 스케일 값으로 바꾸는 커밋(1d8bbbe)도 함께 포함되어 있는데, DeleteButton과는 무관한 별도 스타일 정리라 커밋을 분리해뒀습니다.

Screenshot 📷

2026-07-02.4.54.09.mov



Test Checklist ✔

  • pnpm --filter @repo/timo-design-system check-types 통과
  • pnpm --filter @repo/timo-design-system lint 통과
  • pnpm --filter @repo/timo-design-system build:storybook 실행 → 정적 빌드 성공 확인
  • 브라우저에서 :active 상태(파란 배경 전환) 실제 확인 — 미실행: 로컬 브라우저 자동화 도구 없음
  • pnpm build — 미실행: CI에서 확인 예정

- TrashOnIcon과 "삭제하기" 텍스트로 구성된 삭제 버튼 컴포넌트를 추가했습니다
- 기본은 흰 배경, active(누르는 동안)에는 파란 배경/흰 아이콘·텍스트로 전환됩니다
- Figma 스펙(80x33)에 맞춰 고정 크기로 구현했습니다
- w-[340px], h-[200px] 등 임의값 클래스를 w-80, h-50 등 Tailwind 스케일 값으로 변경했습니다
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
timo Ready Ready Preview, Comment Jul 2, 2026 7:53am

@github-actions github-actions Bot added the ⌚ Timo-Design-system Timo 디자인 시스템 label Jul 2, 2026
@github-actions github-actions Bot added ✨ Feature 새로운 기능(기능성) 구현 ♠️ 정민 정민양 labels Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

TrashOnIcon을 사용하는 DeleteButton 컴포넌트와 DeleteButtonProps 인터페이스가 추가되고, Storybook 스토리와 components/index.ts export가 함께 구성되었습니다. 별도로 Scrollbar 스토리의 크기 클래스가 arbitrary 값에서 Tailwind 스케일 클래스로 변경되었습니다.

Changes

DeleteButton 컴포넌트 구현

Layer / File(s) Summary
DeleteButton 컴포넌트 및 export
packages/timo-design-system/src/components/button/delete-button/DeleteButton.tsx, packages/timo-design-system/src/components/index.ts
onClick prop을 받는 DeleteButtonPropsTrashOnIcon을 표시하는 DeleteButton 컴포넌트가 추가되고, cn으로 조합된 클래스가 active: 상태에서 색상/아이콘 fill을 변경합니다. components/index.ts에서 DeleteButton이 re-export됩니다.
DeleteButton Storybook 스토리
packages/timo-design-system/src/components/button/delete-button/DeleteButton.stories.tsx
centered 레이아웃과 배경색 옵션을 가진 메타, 더미 onClick을 사용하는 Default 스토리가 추가되었습니다.

Scrollbar 스토리 클래스 조정

Layer / File(s) Summary
스크롤 영역 크기 클래스 변경
packages/timo-design-system/src/components/layout/scrollbar/Scrollbar.stories.tsx
세로/가로 스크롤 프리뷰의 컨테이너 및 아이템 크기가 arbitrary 값(w-[340px] 등)에서 Tailwind 스케일 클래스(w-80 등)로 변경되었습니다.

Estimated code review effort: 2 (Simple) | ~10분

Sequence Diagram(s)

sequenceDiagram
  participant Consumer
  participant DeleteButton
  participant TrashOnIcon
  Consumer->>DeleteButton: onClick 콜백 전달
  DeleteButton->>TrashOnIcon: 아이콘 렌더링
  Consumer->>DeleteButton: 클릭 이벤트 발생
  DeleteButton-->>Consumer: onClick 실행
Loading

Suggested reviewers: yumin-kim2, ehye1, kimminna

🐰 삭제 버튼 하나 만드는데,
아이콘도 색깔도 신경 썼네요,
클릭하면 사라지는 마법처럼,
스크롤바도 살짝 다이어트했네요,
작은 변화들이 모여 토끼굴을 채운답니다 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Scrollbar.stories.tsx의 Tailwind 크기 정리 변경은 DeleteButton 이슈와 무관한 별도 수정입니다. Scrollbar 스토리 수정은 별도 PR로 분리하거나 이 PR에서 제거해 DeleteButton 범위만 남겨주세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 DeleteButton 컴포넌트 추가라는 핵심 변경을 정확히 요약합니다.
Linked Issues check ✅ Passed Issue #77의 핵심 요구인 DeleteButton 구현, 스토리북 추가, export 노출이 반영됐습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed PR 설명이 DeleteButton 추가와 Storybook, export 변경 내용과 일치해 변경 사항을 잘 설명합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ui/77-delete-button

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Storybook Preview

항목 링크
Storybook 열기
Chromatic 빌드 확인

마지막 업데이트: 2026-07-02 07:54 UTC

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Timo Performance Report

Bundle Size — timo-web
라우트 크기 First Load JS
/ 0 B 🟡 205.49 kB
/focus 0 B 🟡 205.49 kB
/home 0 B 🟡 205.49 kB
/login 0 B 🟡 205.49 kB
/onboarding 0 B 🟡 205.49 kB
/settings 0 B 🟡 205.49 kB
/settings/account 0 B 🟡 205.49 kB
/settings/policy 0 B 🟡 205.49 kB
/statistics 0 B 🟡 205.49 kB
/today 0 B 🟡 205.49 kB

공유 번들: 205.49 kB
🟢 < 200kB  |  🟡 < 350kB  |  🔴 ≥ 350kB (First Load JS · gzip)

Lighthouse — timo-web

⚠️ Lighthouse 결과를 가져오지 못했습니다.

Image Optimization — timo-web

public/ 디렉토리에 이미지가 없습니다.

측정 커밋: fafec58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with 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.

Inline comments:
In
`@packages/timo-design-system/src/components/button/delete-button/DeleteButton.tsx`:
- Around line 4-6: DeleteButtonProps currently only exposes onClick, but the
requested API also needs disabled for proper button state control. Update
DeleteButtonProps in DeleteButton to include a disabled prop, and make sure the
DeleteButton component forwards it to the underlying button element and handles
the disabled styling/accessibility consistently. Use DeleteButtonProps and
DeleteButton as the symbols to locate and update the prop contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5819e34e-b7a9-414d-bf91-09dfc0df7c0d

📥 Commits

Reviewing files that changed from the base of the PR and between 293536e and 1d8bbbe.

📒 Files selected for processing (4)
  • packages/timo-design-system/src/components/button/delete-button/DeleteButton.stories.tsx
  • packages/timo-design-system/src/components/button/delete-button/DeleteButton.tsx
  • packages/timo-design-system/src/components/index.ts
  • packages/timo-design-system/src/components/layout/scrollbar/Scrollbar.stories.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새로운 기능(기능성) 구현 ⌚ Timo-Design-system Timo 디자인 시스템 ♠️ 정민 정민양

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 삭제하기 버튼(DeleteButton) 컴포넌트 구현

1 participant