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

fix(button): 버튼의 동적 스타일을 컴포넌트에서 관리하도록 변경 #76

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

noahluftyang
Copy link
Collaborator

@noahluftyang noahluftyang commented Jan 5, 2025

변경사항

  • 버튼 테스트 깨지는 문제 해결
  • color와 variant로 제어하는 동적인 스타일을 css로 처리하는 대신 컴포넌트에서 분기로 처리하도록 변경
    • 복잡도 관리 측면에서 동적 스타일을 css로 제어하면 유지보수가 어려울 수 있어요

시각자료

체크리스트

  • 기능 명세를 작성하였나요?
  • 테스트 코드를 작성하였나요?

추가 논의사항

Summary by CodeRabbit

릴리즈 노트

  • 새로운 기능

    • 버튼 컴포넌트의 동적 스타일링 기능 개선
  • 버그 수정

    • 버튼 스타일 관리 로직 최적화
    • 색상 및 변형 스타일 일관성 향상
  • 개선 사항

    • CSS 변수를 활용한 유연한 버튼 스타일링
    • 스타일 정의 방식 모듈화 및 선언적 접근 강화
  • 종속성 업데이트

    • 새로운 라이브러리 추가: @radix-ui/react-slot, clsx, ts-pattern

Copy link

changeset-bot bot commented Jan 5, 2025

🦋 Changeset detected

Latest commit: fb3d2d4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@sipe-team/button Patch
@sipe-team/input Patch
@sipe-team/badge Patch
@sipe-team/card Patch
@sipe-team/divider Patch
@sipe-team/radio-group Patch
@sipe-team/side Patch
@sipe-team/skeleton Patch
@sipe-team/switch Patch
@sipe-team/tooltip Patch
@sipe-team/typography Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

coderabbitai bot commented Jan 5, 2025

Warning

Rate limit exceeded

@noahluftyang has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 23 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 4f1f1bc and fb3d2d4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .changeset/happy-seas-cross.md (1 hunks)
  • packages/button/package.json (2 hunks)
  • packages/button/src/Button.module.css (1 hunks)
  • packages/button/src/Button.stories.tsx (4 hunks)
  • packages/button/src/Button.test.tsx (1 hunks)
  • packages/button/src/Button.tsx (2 hunks)
  • packages/button/tsup.config.ts (1 hunks)
  • packages/button/vitest.config.ts (1 hunks)
  • packages/button/vitest.setup.ts (1 hunks)

Walkthrough

@sipe-team/button 컴포넌트의 스타일링 및 구성에 대한 포괄적인 업데이트가 수행되었습니다. 이 변경은 버튼의 동적 스타일 처리, 의존성 관리, 테스트 설정, 빌드 구성 등 여러 측면을 개선합니다. 주요 초점은 더 유연하고 일관된 버튼 컴포넌트 구현에 맞춰져 있으며, 타입스크립트와 CSS 모듈을 활용하여 스타일 관리를 최적화했습니다.

Changes

파일 변경 요약
.changeset/happy-seas-cross.md 패치 추가: @sipe-team/button 컴포넌트
packages/button/package.json - 저장소 URL 업데이트
- 린트 스크립트 변경
- 새로운 의존성 추가
- ./styles.css 익스포트 추가
packages/button/src/Button.module.css - 기존 클래스 정의 제거
- 동적 CSS 변수 기반 스타일링으로 변경
packages/button/src/Button.stories.tsx - 스토리 포맷팅 개선
- variant 인자 추가
packages/button/src/Button.test.tsx - 배경색 테스트 값 업데이트
packages/button/src/Button.tsx - 타입 선언 업데이트
- getButtonStyle 함수 추가
- 스타일 로직 리팩토링
packages/button/tsup.config.ts 기본 구성 파일로 대체
packages/button/vitest.config.ts 테스트 구성 간소화
packages/button/vitest.setup.ts 테스트 라이브러리 임포트 변경

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • bae-sh
  • heeji289
  • developerjhp
  • synuns
  • kimdaeyeobbb
  • froggy1014
  • hy57in

Poem

🐰 버튼의 춤, 스타일의 노래
동적인 색깔, 변화의 물결
코드는 흐르고, 스타일은 춤추네
리팩토링의 마법, 토끼의 미소
새로운 버튼, 반짝이는 희망! 🌈


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jan 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
packages/button/src/Button.test.tsx 100.00% <100.00%> (ø)
packages/button/src/Button.tsx 100.00% <100.00%> (ø)

@noahluftyang noahluftyang force-pushed the fix/button-dynamic-style branch from 4f1f1bc to fb3d2d4 Compare January 5, 2025 07:04
@noahluftyang noahluftyang enabled auto-merge (squash) January 5, 2025 07:05
Copy link
Contributor

@froggy1014 froggy1014 left a comment

Choose a reason for hiding this comment

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

LGTM 믿고 있었다고 ~

@noahluftyang noahluftyang merged commit 4c48243 into main Jan 5, 2025
6 of 7 checks passed
@noahluftyang noahluftyang deleted the fix/button-dynamic-style branch January 5, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants