Skip to content

feat(theme): radius, primitive, dimension 토큰 도입#561

Merged
Sh031224 merged 11 commits into
feature/4.0.0from
feature/dididoeun/add-tokens
May 26, 2026
Merged

feat(theme): radius, primitive, dimension 토큰 도입#561
Sh031224 merged 11 commits into
feature/4.0.0from
feature/dididoeun/add-tokens

Conversation

@dididoeun
Copy link
Copy Markdown
Collaborator

@dididoeun dididoeun commented May 21, 2026

Summary

theme: token 추가

  • Figma "2 Typo / Grid / Number" 라이브러리(fileKey 2orYfqIiuFhTGXKN1GARg7)의 Primitive, Spacing, Radius 컬렉션을 wds-theme에 동기화합니다.
  • packages/wds-theme/src/theme/primitive/index.ts 신규 추가 — raw px 스케일 (0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 20, 24, 32, 40, 48, 56, 64, 72, 80, 9999). Figma의 scopes: [] 처리에 대응하는 alias 전용 토큰입니다.
  • packages/wds-theme/src/theme/radius/index.ts 신규 추가 — radius.{0, 4, 8, 10, 12, 14, 16, 20, 24, full}로 primitive를 alias (full = 9999px).
  • packages/wds-theme/src/theme/spacing/index.ts를 primitive alias 구조로 리팩터. 0.5: '0.5px' 키는 Figma에는 없지만 하위 호환을 위해 literal로 유지.
  • theme/index.tslightOriginTheme·darkOriginThemeprimitive, radius 등록. types/index.tsPrimitive, Radius 타입 export.

border-radius가 박혀 있는 기타 packages/wds/src/components/**·utils/framed-style.ts 마이그레이션은 별도 PR에서 처리할 예정입니다.

_No Jira ticket — internal token sync

Summary by CodeRabbit

  • 테마
    • 디자인 토큰(primitive, radius, dimension) 추가 및 간격 토큰 참조 방식 정리

Review Change Stack

@dididoeun dididoeun added this to the 3.7.0 milestone May 21, 2026
@dididoeun dididoeun self-assigned this May 21, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

primitive 기반 토큰(primitive, radius, dimension) 추가와 spacing 리팩토링, origin theme·타입 통합 및 IconButton의 size/interaction 스타일·로직 변경과 관련 문서 데모 수정이 포함됩니다.

Changes

테마 토큰 시스템 확장

Layer / File(s) Summary
Primitive 토큰 모듈 정의
packages/wds-theme/src/theme/primitive/index.ts
숫자 키(0,2,4,...,9999)를 픽셀 문자열로 매핑한 primitive 상수를 as const로 선언하고 기본 export합니다.
Radius 매핑 및 Spacing 리팩토링
packages/wds-theme/src/theme/radius/index.ts, packages/wds-theme/src/theme/spacing/index.ts
radiusprimitive 특정 인덱스를 사용해 반경 키(0,4,8,10,12,14,16,20,24,full)를 구성하고, spacing의 하드코딩된 값들을 primitive[...] 참조로 대체합니다.
Dimension 매핑 및 Theme 통합
packages/wds-theme/src/theme/dimension/index.ts, packages/wds-theme/src/theme/index.ts, packages/wds-theme/src/types/index.ts
dimensionprimitive 인덱스에서 매핑해 export하고, lightOriginTheme/darkOriginThemeprimitive, radius, dimension을 포함시키며 해당 타입(Primitive, Radius, Dimension)을 export합니다.

IconButton 크기·상호작용 및 문서 업데이트

Layer / File(s) Summary
IconButton 타입 확장
packages/wds/src/components/icon-button/types.ts
size 유니온에 largexlarge를 추가하고 관련 JSDoc 설명을 상세화합니다.
스타일 헬퍼 및 padding 조정
packages/wds/src/components/icon-button/style.ts
ICON_SIZE_PRESET 등 헬퍼 추가, outlined/solid의 large/xlarge를 medium으로 재매핑, 숫자/medium/small padding 소폭 증가, normal variant의 with-interaction에 border-radius 적용 및 disabled 처리 내부 이동.
로직: 상호작용 높이 및 scale 고정
packages/wds/src/components/icon-button/index.tsx
getInteractionSize에서 normal variant의 interaction 높이를 size별로 세분화(24/28/32/40px)하고, WithInteraction에 전달되는 scale을 항상 false로 변경합니다.
문서: IconButton Sizes 데모 갱신
docs/data/components/actions/icon-button/web.mdx
Sizes 설명을 재구성하고 normal/outlined/solid 데모 레이아웃 및 버튼 속성(variant/size/aria-label)을 갱신합니다.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed 제목은 PR의 주요 변경 사항인 radius, primitive, dimension 토큰 도입을 명확하게 반영하고 있으며, 변경된 핵심 내용을 간결하게 요약하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/dididoeun/add-tokens

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

size-limit report 📦

Path Size
@montage-ui/core 2.35 KB (0%)
@montage-ui/icon 3.84 KB (0%)
@montage-ui/lottie 68 B (0%)
@montage-ui/theme 144 B (0%)
@montage-ui/engine 313 B (0%)
@montage-ui/nextjs 149 B (0%)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

🚀 Preview

Last commit58159a7
Preview URLhttps://dev-montage.wanted.co.kr/58159a7

@dididoeun dididoeun changed the title feat(wds-theme): primitive·spacing·radius 토큰 추가 feat: wds-theme radius 토큰 도입 및 icon-button 적용 May 21, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/wds/src/components/icon-button/index.tsx (1)

60-73: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

반응형 size에서 interaction 높이가 동기화되지 않습니다.

Line 60-73의 getInteractionSize()는 base size만 보고 고정 px를 반환해서, xs/sm/md/lg/xl로 size가 바뀌는 경우 interaction 영역 높이가 실제 아이콘 버튼 크기와 어긋날 수 있습니다. 이 변경은 normal variant의 터치/포커스 영역 정확도를 깨뜨립니다. calc(100% + Npx) 기반으로 상대 계산을 유지하거나, breakpoint별 interaction size를 함께 계산해 전달하도록 맞춰주세요.

🤖 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/wds/src/components/icon-button/index.tsx` around lines 60 - 73,
getInteractionSize() currently returns fixed px values for the 'normal' variant
using base sizes (small/medium/large/xlarge), which breaks alignment when the
component uses responsive size tokens (xs/sm/md/lg/xl); update
getInteractionSize to compute interaction height relative to the rendered button
instead of hardcoded px: for 'normal' return calc(100% + Npx) variants (choose
the appropriate N per size token) or map responsive size tokens (xs/sm/md/lg/xl)
to corresponding calc(...) expressions so the interaction area scales with CSS
size changes; ensure you modify the logic inside getInteractionSize() (handling
the 'normal' case and all size values) so it returns percentage-based calc
values rather than fixed pixel strings.
🤖 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.

Outside diff comments:
In `@packages/wds/src/components/icon-button/index.tsx`:
- Around line 60-73: getInteractionSize() currently returns fixed px values for
the 'normal' variant using base sizes (small/medium/large/xlarge), which breaks
alignment when the component uses responsive size tokens (xs/sm/md/lg/xl);
update getInteractionSize to compute interaction height relative to the rendered
button instead of hardcoded px: for 'normal' return calc(100% + Npx) variants
(choose the appropriate N per size token) or map responsive size tokens
(xs/sm/md/lg/xl) to corresponding calc(...) expressions so the interaction area
scales with CSS size changes; ensure you modify the logic inside
getInteractionSize() (handling the 'normal' case and all size values) so it
returns percentage-based calc values rather than fixed pixel strings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 09fac16b-435e-476a-9a62-3b7b5694b8f8

📥 Commits

Reviewing files that changed from the base of the PR and between 534a74f and d4fbda2.

📒 Files selected for processing (8)
  • docs/data/components/actions/icon-button/web.mdx
  • packages/wds-theme/src/theme/dimension/index.ts
  • packages/wds-theme/src/theme/index.ts
  • packages/wds-theme/src/theme/primitive/index.ts
  • packages/wds-theme/src/types/index.ts
  • packages/wds/src/components/icon-button/index.tsx
  • packages/wds/src/components/icon-button/style.ts
  • packages/wds/src/components/icon-button/types.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/wds-theme/src/theme/primitive/index.ts

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/wds/src/components/icon-button/style.ts (1)

33-41: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

normal 기본 크기에서 상호작용 높이 기본값이 스펙과 불일치합니다.

Line 40의 fallback이 36px이라 size 미지정 시 normal 버튼은 아이콘 기본값(24px) 대비 상호작용 높이/반경이 xlarge 매핑(40px/radius[12])과 어긋납니다.

제안 수정안
 const getNormalInteractionHeight = (size: IconButtonProps['size']): number => {
   if (typeof size === 'string' && size in NORMAL_INTERACTION_HEIGHT) {
     return NORMAL_INTERACTION_HEIGHT[
       size as keyof typeof NORMAL_INTERACTION_HEIGHT
     ];
   }
   if (typeof size === 'number') return size + 12;
-  return 24 + 12;
+  return NORMAL_INTERACTION_HEIGHT.xlarge;
 };
🤖 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/wds/src/components/icon-button/style.ts` around lines 33 - 41, The
fallback in getNormalInteractionHeight produces 36px for unspecified sizes which
misaligns with the design spec; update the function to return the canonical
mapping for the "normal" size instead of 24 + 12 when size is not provided or
not recognized. Specifically, in getNormalInteractionHeight (and in relation to
NORMAL_INTERACTION_HEIGHT and IconButtonProps['size']), replace the final
fallback return with NORMAL_INTERACTION_HEIGHT['normal'] (or the equivalent
lookup) so the default interaction height matches the spec's "normal" value.
🤖 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.

Outside diff comments:
In `@packages/wds/src/components/icon-button/style.ts`:
- Around line 33-41: The fallback in getNormalInteractionHeight produces 36px
for unspecified sizes which misaligns with the design spec; update the function
to return the canonical mapping for the "normal" size instead of 24 + 12 when
size is not provided or not recognized. Specifically, in
getNormalInteractionHeight (and in relation to NORMAL_INTERACTION_HEIGHT and
IconButtonProps['size']), replace the final fallback return with
NORMAL_INTERACTION_HEIGHT['normal'] (or the equivalent lookup) so the default
interaction height matches the spec's "normal" value.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6347fa4b-9971-4b1a-9467-66d511473739

📥 Commits

Reviewing files that changed from the base of the PR and between f45fd1c and 7658bb2.

📒 Files selected for processing (2)
  • packages/wds/src/components/icon-button/index.tsx
  • packages/wds/src/components/icon-button/style.ts
💤 Files with no reviewable changes (1)
  • packages/wds/src/components/icon-button/index.tsx

@Sh031224 Sh031224 force-pushed the feature/dididoeun/add-tokens branch from a5e6ef6 to 222b723 Compare May 26, 2026 07:53
@Sh031224 Sh031224 changed the title feat: wds-theme radius 토큰 도입 및 icon-button 적용 feat(theme): radius, primitive, dimension 토큰 도입 및 icon-button 적용 May 26, 2026
@Sh031224 Sh031224 changed the base branch from main to feature/4.0.0 May 26, 2026 07:58
dididoeun and others added 9 commits May 26, 2026 17:08
사용처가 없어 제거. primitive[1]은 alias 소스로 유지.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- size에 'xlarge'/'large' 추가 (normal 전용)
- background variant는 프리셋 없이 number만 지원
- normal interaction 크기 고정: small=24 medium=28 large=32 xlarge=40
- normal interaction border-radius를 height × 0.3 → 가장 가까운 wds-theme radius 토큰으로 매핑
- normal scale 효과 제거 (rest 크기가 시안과 일치하도록)
- solid/outlined padding 1px씩 증가 (medium 10→11 small 7→8 number 6→7)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Figma "2 Typo / Grid / Number" 파일의 Dimension 컬렉션과 동기화.
button medium icon (18px) 커버를 위해 primitive에 18 추가.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
스냅샷이 봇 커밋(3833d8d)으로 갱신되어 PR Test가 재실행되지 않음.
Figma "2 Typo / Grid / Number" 파일에 추가된 Primitive/28 Dimension/28과 동기화.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CodeRabbit 지적 반영. getInteractionSize는 base size만 보고 고정 px를 반환해
xs/sm/md/lg/xl로 size가 바뀌어도 interaction 높이가 따라가지 못함.

- index.tsx에서 height prop / getInteractionSize 제거
- style.ts에 interactionChildStyle 헬퍼 추가 (variant+size별 height·border-radius)
- iconButtonStyle base 블록과 createResponsiveStyle 블록 양쪽에 적용
- iconButtonColorStyle에서 normal radius 계산 제거(헬퍼로 이동)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Figma "2 Typo / Grid / Number" 파일의 Dimension/12 (→ Primitive/12 alias)와 동기화.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Sh031224 Sh031224 force-pushed the feature/dididoeun/add-tokens branch from 222b723 to 348dbf4 Compare May 26, 2026 08:09
@Sh031224 Sh031224 changed the title feat(theme): radius, primitive, dimension 토큰 도입 및 icon-button 적용 feat(theme): radius, primitive, dimension 토큰 도입 May 26, 2026
Sh031224 and others added 2 commits May 26, 2026 17:28
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Sh031224 Sh031224 modified the milestones: 3.7.0, 4.0.0 May 26, 2026
@Sh031224 Sh031224 merged commit 7f7d8e2 into feature/4.0.0 May 26, 2026
9 checks passed
@Sh031224 Sh031224 deleted the feature/dididoeun/add-tokens branch May 26, 2026 08:35
Sh031224 added a commit that referenced this pull request May 28, 2026
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sh031224 <1cktmdgh2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants