Skip to content

refactor: 디자인 시스템 일관성 개선, baseframe 리팩토링, Storybook 문서화#86

Closed
ohprettyhak wants to merge 17 commits intowipfrom
feat/design-system-consistency
Closed

refactor: 디자인 시스템 일관성 개선, baseframe 리팩토링, Storybook 문서화#86
ohprettyhak wants to merge 17 commits intowipfrom
feat/design-system-consistency

Conversation

@ohprettyhak
Copy link
Contributor

@ohprettyhak ohprettyhak commented Feb 12, 2026

Summary

  • Phase 1: baseframe YAML 소스 기반 radius/font-weight 토큰 시스템 구축 및 CLI 파이프라인 재생성
  • Phase 2: Button errordanger variant, Select 2xs 제거 및 높이 통일, 내부 함수/import 네이밍 정리
  • Phase 3: 하드코딩 px → spacing/radius 토큰 전환, CSS 모듈 border-radius 토큰화, disabled opacity 0.4 통일
  • Phase 4: baseframe 파서 모듈 분리 및 코드 품질 개선, 196개 유닛 테스트 추가
  • Phase 5: Storybook 리팩토링 — AllVariants 단일 스토리를 prop 차원별 독립 스토리로 분리, 일관된 레이아웃/네이밍/문서화 패턴 적용
  • 기타: Button/Select xl 사이즈 제거, Storybook 10.2.8 업데이트, Checkbox/Switch 버그 수정

Breaking Changes

  • Button: variant="error"variant="danger"
  • Select: size="2xs" 제거 (xs~lg만 지원)
  • Button: size="xl" 제거 (xs~lg만 지원)
  • Select: size="xl" 제거 (xs~lg만 지원)

Phase 5: Storybook 리팩토링 상세

변경 원칙

  • 스토리 분리: AllVariants 하나에 모든 것을 담던 구조 → prop 차원별 독립 스토리 (Default, Sizes, Variants, States, Composition, Playground)
  • 일관된 레이아웃: containerStyle, sectionStyle, rowStyle 공통 패턴 적용
  • 문서화: 모든 스토리에 parameters.docs.description.story 추가
  • 네이밍 통일: Radix/Chakra/MUI 수준의 일관된 스토리 네이밍

컴포넌트별 스토리 변경 (20개 파일)

컴포넌트 기존 변경 후
Button AllVariants 외 5개 Default, Sizes, Variants, Shapes, States, WithIcons, Playground (7개)
Badge AllVariants, Playground Default, Sizes, Variants, Playground (4개)
Link AllVariants, Playground Default, Sizes, Weights, WithIndicator, Playground (5개)
Select AllVariants, Playground Default, Sizes, Disabled, Playground (4개)
Spinner AllVariants, Playground Default, Sizes, Colors, Playground (4개)
Typography AllVariants, Playground Default, Display, Heading, Body, Weights, Playground (6개)
Checkbox AllVariants, Playground Default, Sizes, States, Disabled, Playground (5개)
Switch AllVariants, Playground Default, Sizes, LabelPositions, Disabled, Playground (5개)
RadioGroup AllVariants, Playground Default, Disabled, Playground (3개)
Accordion AllVariants, Playground Default, Single, Multiple, Playground (4개)
Modal AllVariants, Playground Default, Confirm, Danger, Playground (4개)
Dropdown AllVariants, Playground Default, IconTrigger, Playground (3개)
Popover AllVariants, Playground Default, WithForm, Playground (3개)
Tab AllVariants, Playground Default, WithContent, Playground (3개)
Toast AllVariants, Playground Default, Types, Playground (3개)
Pagination AllVariants, Playground Default, ManyPages, Playground (3개)
OTP Field AllVariants, Playground Default, Lengths, Disabled, Playground (4개)
StockQuantityStatus AllVariants, Playground Default, AllStatuses, Playground (3개)
DayPicker 10개 (유지) description 추가
MonthPicker 6개 (유지) description 추가

변경 파일 (87개)

토큰 시스템 (Phase 1)

파일 변경 내용
baseframe/primitive/radius.yaml 신규 생성
baseframe/primitive/font-weight.yaml 신규 생성
baseframe/semantic/color.yaml 참조 형식 수정
css/token.css, css/tailwind4.css CLI 파이프라인 재생성
react/src/token/radius.ts 신규 생성
react/src/token/index.ts radius export 추가

컴포넌트 리팩토링 (Phase 2-3)

파일 변경 내용
button/Button.tsx error→danger, px→token, xl 제거
select/Select.tsx 2xs/xl 제거, 높이 통일
badge/Badge.tsx cx 통일, 타입 export, radius
switch/Switch.tsx 함수명 정리
spinner/Spinner.tsx px→spacing token
CSS 모듈 (Modal, Checkbox 등) radius 토큰화, opacity 통일

baseframe 파서 리팩토링 (Phase 4)

파일 변경 내용
parsers/primitives.ts 신규 — 원시 파서 함수 추출
parsers/shadow.ts 신규 — shadow/color 파서 추출
parsers/value.ts 277줄 → 67줄로 축소
builders/utils/naming.ts 신규 — 공유 createVarName 추출
builders/tailwind.ts, css-vars.ts 중복 createVarName 제거
transforms/resolve.ts 미사용 mode 파라미터 제거
테스트 파일 196개 유닛 테스트 추가

Storybook 리팩토링 (Phase 5)

20개 .stories.tsx 파일 — 위 테이블 참조

Test plan

  • pnpm biome check . 통과 (243 파일)
  • pnpm build 통과 (5 tasks)
  • pnpm --filter storybook build 통과
  • baseframe 유닛 테스트 196개 통과
  • Storybook에서 모든 컴포넌트 시각적 확인

🤖 Generated with Claude Code

ohprettyhak and others added 6 commits February 12, 2026 13:43
- primitive/radius.yaml 신규 생성 (none~circle)
- primitive/font-weight.yaml 신규 생성 (thin~black)
- semantic/color.yaml 참조 형식 수정 (dot → hyphen)
- token.css, tailwind4.css를 baseframe CLI 파이프라인으로 재생성

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- token/radius.ts 신규 생성 (CSS 변수 참조)
- token/index.ts에 radius export 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ButtonVariant error → danger 네이밍 통일
- getColor → getFontColor 내부 함수명 명확화
- 하드코딩 px → spacing/radius 토큰으로 전환
- docs 예제 컴포넌트 동기화

BREAKING CHANGE: variant="error"를 variant="danger"로 변경 필요

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- SelectSize에서 2xs 제거
- 높이 매핑을 Button과 동일하게 통일 (xs~xl)
- SelectSize 타입 export 추가
- docs 예제 컴포넌트 동기화

BREAKING CHANGE: size="2xs" 제거, xs~xl 사이즈만 지원

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Badge: clsx→cx import 패턴 통일, BadgeSize/BadgeVariant 타입 export, radius 토큰 적용
- Switch: getSwitchWidth→getWidth, getSwitchHeight→getHeight 함수명 정리
- StockQuantityStatus: getColor export 제거 (내부 전용)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Modal: 12px → var(--ds-radius-xl)
- DayPicker: 8px → var(--ds-radius-lg), opacity 0.3 → 0.4
- MonthPicker: 8px → var(--ds-radius-lg)
- Checkbox: 4px → var(--ds-radius-sm)
- RadioGroup: opacity 0.5 → 0.4
- Spinner: 하드코딩 px → spacing 토큰

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 12, 2026

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

Project Deployment Actions Updated (UTC)
cocso-ui Ready Ready Preview, Comment Feb 12, 2026 11:51am
cocso-ui-storybook Ready Ready Preview, Comment Feb 12, 2026 11:51am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

⚠️ No Changeset found

Latest commit: beb08c5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/design-system-consistency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ohprettyhak, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 디자인 시스템의 일관성을 강화하기 위해 토큰, 네이밍 규칙 및 값들을 통일하는 작업을 수행합니다. 새로운 radius 및 font-weight 토큰을 도입하고, Button 컴포넌트의 'error' variant를 'danger'로 변경하며, Select 컴포넌트의 '2xs' 사이즈를 제거하는 등 여러 컴포넌트의 변형을 업데이트했습니다. 또한, 하드코딩된 픽셀 값들을 spacing 및 radius 토큰으로 대체하여 디자인 시스템 전반의 유지보수성과 확장성을 개선했습니다.

Highlights

  • 토큰 시스템 구축: baseframe YAML 소스를 기반으로 radius 및 font-weight 토큰 시스템을 구축하고 CLI 파이프라인을 재생성했습니다.
  • 컴포넌트 일관성 개선: Button 컴포넌트의 'error' variant를 'danger'로 변경하고, Select 컴포넌트에서 '2xs' 사이즈를 제거하여 높이를 통일했습니다.
  • 하드코딩 값 토큰화: 하드코딩된 px 값을 spacing 및 radius 토큰으로 전환하고, CSS 모듈의 border-radius를 토큰화했으며, disabled 상태의 opacity를 0.4로 통일했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/website/src/components/example/button-variant.tsx
    • Button 컴포넌트의 variant를 'error'에서 'danger'로 업데이트했습니다.
  • docs/website/src/components/example/select-size.tsx
    • Select 컴포넌트의 '2xs' 사이즈 옵션을 제거했습니다.
  • packages/baseframe/primitive/font-weight.yaml
    • 새로운 font-weight 프리미티브 토큰을 추가했습니다.
  • packages/baseframe/primitive/radius.yaml
    • 새로운 radius 프리미티브 토큰을 추가했습니다.
  • packages/baseframe/semantic/color.yaml
    • 색상 토큰 참조 형식을 점(.)에서 하이픈(-)으로 수정했습니다.
  • packages/css/tailwind4.css
    • 새로운 토큰 정의를 포함하도록 CSS를 재생성하고, spacing 및 radius 유틸리티를 추가했습니다.
  • packages/css/token.css
    • radius 및 font-weight를 포함한 새로운 토큰 정의로 CSS를 재생성했습니다.
  • packages/react/src/badge/Badge.tsx
    • clsx import alias를 cx로 변경했습니다.
    • radius 토큰을 import했습니다.
    • BadgeSize 및 BadgeVariant 타입을 export했습니다.
    • 하드코딩된 border-radius 값을 radius.md 토큰으로 대체했습니다.
  • packages/react/src/button/Button.stories.tsx
    • Storybook에서 Button variant 옵션을 'error'에서 'danger'로 업데이트했습니다.
  • packages/react/src/button/Button.tsx
    • radius 및 spacing 토큰을 import했습니다.
    • ButtonVariant 타입을 'error'에서 'danger'로 변경했습니다.
    • getColor 함수 이름을 getFontColor로 변경했습니다.
    • 높이 및 border-radius에 대한 하드코딩된 픽셀 값을 spacing 및 radius 토큰으로 대체했습니다.
  • packages/react/src/checkbox/Checkbox.module.css
    • 하드코딩된 border-radius 값을 var(--ds-radius-sm)으로 대체했습니다.
  • packages/react/src/day-picker/DayPicker.module.css
    • 하드코딩된 border-radius 값을 var(--ds-radius-lg)으로 대체했습니다.
    • disabled 상태의 opacity를 0.3에서 0.4로 업데이트했습니다.
  • packages/react/src/modal/Modal.module.css
    • 하드코딩된 border-radius 값을 var(--ds-radius-xl)으로 대체했습니다.
  • packages/react/src/modal/Modal.stories.tsx
    • Modal 예제에서 Button variant를 'error'에서 'danger'로 업데이트했습니다.
  • packages/react/src/month-picker/MonthPicker.module.css
    • 하드코딩된 border-radius 값을 var(--ds-radius-lg)으로 대체했습니다.
  • packages/react/src/radio-group/RadioGroup.module.css
    • disabled 상태의 opacity를 0.5에서 0.4로 업데이트했습니다.
  • packages/react/src/select/Select.stories.tsx
    • Select Storybook에서 '2xs' 사이즈 옵션을 제거했습니다.
  • packages/react/src/select/Select.tsx
    • SelectSize 타입에서 '2xs'를 제거했습니다.
    • getStyles 함수를 업데이트하여 '2xs'를 제거하고 다른 사이즈의 높이를 통일했습니다.
  • packages/react/src/spinner/Spinner.tsx
    • spacing 토큰을 import했습니다.
    • 스피너 사이즈에 대한 하드코딩된 픽셀 값을 spacing 토큰으로 대체했습니다.
  • packages/react/src/stock-quantity-status/StockQuantityStatus.tsx
    • getColor 함수의 export를 제거하여 내부 함수로 변경했습니다.
  • packages/react/src/switch/Switch.tsx
    • getSwitchWidth 함수 이름을 getWidth로, getSwitchHeight 함수 이름을 getHeight로 변경했습니다.
  • packages/react/src/token/index.ts
    • radius 토큰을 export했습니다.
  • packages/react/src/token/radius.ts
    • 새로운 radius 토큰 정의를 추가했습니다.
Activity
  • PR 작성자가 제공한 테스트 계획에 따라 packages/react 및 docs/website TypeScript 빌드는 통과했습니다.
  • Storybook에서 모든 컴포넌트의 시각적 확인은 아직 완료되지 않았습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 디자인 시스템의 일관성을 높이기 위한 중요한 리팩터링을 담고 있습니다. 전반적으로 토큰 시스템을 도입하고, 네이밍을 정리하며, 하드코딩된 값들을 토큰으로 대체하는 변경 사항들이 인상적입니다. 특히 Button 컴포넌트의 varianterror에서 danger로 변경하고 Select 컴포넌트의 2xs 사이즈를 제거하는 등, Breaking Changes를 포함한 과감한 개선이 돋보입니다. 코드 변경 사항들을 검토한 결과, 대부분의 변경점이 PR의 목표에 잘 부합하며 코드 품질을 향상시키는 방향으로 이루어졌습니다. 한 가지 CSS 유틸리티 정의에서 발견된 잠재적인 오류에 대해 리뷰 코멘트를 남겼으니 확인 부탁드립니다. 훌륭한 작업입니다!

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
10.19.3이 npm registry에서 제거되어 install 실패하는 문제 수정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ohprettyhak and others added 3 commits February 12, 2026 16:35
CI biome check 실패 해결을 위해 docs 예제 파일 포맷팅 및
OTP 컴포넌트 배열 인덱스 키 lint 경고 억제 처리

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SwitchSize는 'sm' | 'md'만 지원하므로 argTypes와 스토리에서
'lg' 참조를 'sm'으로 수정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
intermediate 상태에서 CheckIcon(체크마크) 대신
CheckIndeterminateSmallIcon(대시)을 사용하여 시각적으로 구분되도록 수정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- value.ts(277줄)를 primitives.ts, shadow.ts, value.ts(67줄)로 분리
- 중복된 createVarName을 builders/utils/naming.ts로 추출
- transforms/resolve.ts에서 미사용 mode 파라미터 제거
- transforms/build.ts에서 console 로깅을 Error 메시지로 대체
- $number.1 → --spacing 매직 값 특수 처리 제거
- tailwind4.css에서 var() 참조 토큰을 @theme inline으로 분리

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ohprettyhak ohprettyhak changed the title refactor: 디자인 시스템 일관성 개선 (토큰/네이밍/값 통일) refactor: 디자인 시스템 일관성 개선 및 baseframe 파서 리팩토링 Feb 12, 2026
vitest 설정 및 11개 테스트 파일 작성:
- parsers: hex, rgb, rgba, tokenRef, size, duration, shadow, value, ast
- transforms: validate, resolve, build
- builders: css-vars, tailwind, css utils, naming utils

코드 리뷰 반영: 경계값 테스트 보강, 타입 단언 강화, 소스 동작 문서화

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Select 컴포넌트에서 불필요한 xl 사이즈 옵션 제거
- SelectSize 타입에서 xl 제거
- getStyles에서 xl 분기 제거
- Storybook 및 docs 예제 업데이트

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AllVariants 단일 스토리를 Default/Sizes/Variants/States 등 prop별
독립 스토리로 분리하고, 일관된 레이아웃·네이밍·description 패턴 적용.
DayPicker/MonthPicker는 기존 구조 유지하며 description만 추가.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ohprettyhak ohprettyhak changed the title refactor: 디자인 시스템 일관성 개선 및 baseframe 파서 리팩토링 refactor: 디자인 시스템 일관성 개선, baseframe 리팩토링, Storybook 문서화 Feb 12, 2026
@ohprettyhak ohprettyhak deleted the feat/design-system-consistency branch March 11, 2026 05:27
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.

1 participant